DataPreview
Summary: _typescript_ Reviewed By: danielbuechele Differential Revision: D17180388 fbshipit-source-id: 2375ce5eafbaac75cc789436c9ee1a199a233784
This commit is contained in:
committed by
Facebook Github Bot
parent
e586c53393
commit
f6b371e2be
@@ -16,13 +16,13 @@ const PreviewContainer = styled('span')({
|
|||||||
fontStyle: 'italic',
|
fontStyle: 'italic',
|
||||||
});
|
});
|
||||||
|
|
||||||
function intersperse(arr, sep) {
|
function intersperse(arr: Array<any>, sep: string) {
|
||||||
if (arr.length === 0) {
|
if (arr.length === 0) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
|
||||||
return arr.slice(1).reduce(
|
return arr.slice(1).reduce(
|
||||||
(xs, x, i) => {
|
(xs: any, x: any) => {
|
||||||
return xs.concat([sep, x]);
|
return xs.concat([sep, x]);
|
||||||
},
|
},
|
||||||
[arr[0]],
|
[arr[0]],
|
||||||
@@ -48,7 +48,7 @@ export default class DataPreview extends PureComponent<{
|
|||||||
<PreviewContainer>
|
<PreviewContainer>
|
||||||
{'['}
|
{'['}
|
||||||
{intersperse(
|
{intersperse(
|
||||||
value.map((element, index) => {
|
value.map((element: any, index: number) => {
|
||||||
const res = extractValue(element, depth + 1);
|
const res = extractValue(element, depth + 1);
|
||||||
if (!res) {
|
if (!res) {
|
||||||
return null;
|
return null;
|
||||||
|
|||||||
Reference in New Issue
Block a user