Fixed a bunch of prettier errors after upgrading
Summary: prettier upgrade uncovered more errors Reviewed By: passy Differential Revision: D18474908 fbshipit-source-id: b1553000fb3386f2bbd9defdd3332618e4b9c867
This commit is contained in:
committed by
Facebook Github Bot
parent
677f7b5b5f
commit
f2d12f1025
@@ -7,3 +7,4 @@ flow-typed
|
||||
lib
|
||||
!.eslintrc.js
|
||||
dist
|
||||
website/build
|
||||
|
||||
@@ -274,9 +274,9 @@ async function startFlipper(userArguments: UserArguments) {
|
||||
);
|
||||
const logger = initLogger(store, {isHeadless: true});
|
||||
|
||||
const earlyExitClosures: Array<
|
||||
(userArguments: UserArguments) => Promise<Action>
|
||||
> = [
|
||||
const earlyExitClosures: Array<(
|
||||
userArguments: UserArguments,
|
||||
) => Promise<Action>> = [
|
||||
async (userArguments: UserArguments) => {
|
||||
if (userArguments.listDevices) {
|
||||
const devices = await listDevices(store);
|
||||
@@ -298,9 +298,10 @@ async function startFlipper(userArguments: UserArguments) {
|
||||
|
||||
const cleanupDispatchers = dispatcher(store, logger);
|
||||
|
||||
const storeModifyingClosures: Array<
|
||||
(userArguments: UserArguments, store: Store) => Promise<Action>
|
||||
> = [
|
||||
const storeModifyingClosures: Array<(
|
||||
userArguments: UserArguments,
|
||||
store: Store,
|
||||
) => Promise<Action>> = [
|
||||
async (userArguments: UserArguments, store: Store) => {
|
||||
const {device: selectedDeviceID} = userArguments;
|
||||
if (selectedDeviceID) {
|
||||
@@ -346,9 +347,10 @@ async function startFlipper(userArguments: UserArguments) {
|
||||
},
|
||||
];
|
||||
|
||||
const exitActionClosures: Array<
|
||||
(userArguments: UserArguments, store: Store) => Promise<Action>
|
||||
> = [
|
||||
const exitActionClosures: Array<(
|
||||
userArguments: UserArguments,
|
||||
store: Store,
|
||||
) => Promise<Action>> = [
|
||||
async (userArguments: UserArguments, store: Store) => {
|
||||
const {listPlugins} = userArguments;
|
||||
if (listPlugins) {
|
||||
|
||||
@@ -66,7 +66,10 @@ test('persistedStateReducer is adding data', () => {
|
||||
const tablePlugin = createTablePlugin({...PROPS, method});
|
||||
const id = '1';
|
||||
|
||||
const {rows, datas} = tablePlugin.persistedStateReducer(
|
||||
const {
|
||||
rows,
|
||||
datas,
|
||||
} = tablePlugin.persistedStateReducer(
|
||||
tablePlugin.defaultPersistedState,
|
||||
method,
|
||||
{id},
|
||||
|
||||
@@ -81,8 +81,7 @@ class ExportDataPluginSheet extends Component<Props> {
|
||||
selectedElements={getActivePersistentPlugins(
|
||||
pluginStates,
|
||||
plugins,
|
||||
).reduce(
|
||||
(acc, plugin) => {
|
||||
).reduce((acc, plugin) => {
|
||||
if (
|
||||
plugins.selectedPlugins.length <= 0 ||
|
||||
plugins.selectedPlugins.includes(plugin)
|
||||
@@ -90,9 +89,7 @@ class ExportDataPluginSheet extends Component<Props> {
|
||||
acc.add(plugin);
|
||||
}
|
||||
return acc;
|
||||
},
|
||||
new Set([]) as Set<string>,
|
||||
)}
|
||||
}, new Set([]) as Set<string>)}
|
||||
onHide={onHide}
|
||||
/>
|
||||
);
|
||||
|
||||
@@ -47,7 +47,7 @@ import {BackgroundColorProperty} from 'csstype';
|
||||
import {StyledOtherComponent} from 'create-emotion-styled';
|
||||
import SupportRequestFormManager from '../fb-stubs/SupportRequestFormManager';
|
||||
|
||||
type FlipperPlugins = (typeof FlipperPlugin)[];
|
||||
type FlipperPlugins = typeof FlipperPlugin[];
|
||||
type PluginsByCategory = [string, FlipperPlugins][];
|
||||
|
||||
const ListItem = styled('div')(({active}: {active?: boolean}) => ({
|
||||
|
||||
@@ -108,7 +108,10 @@ test('checkGK for failing plugin', () => {
|
||||
});
|
||||
|
||||
test('requirePlugin returns null for invalid requires', () => {
|
||||
const plugin = requirePlugin([], require)({
|
||||
const plugin = requirePlugin(
|
||||
[],
|
||||
require,
|
||||
)({
|
||||
name: 'pluginID',
|
||||
out: 'this/path/does not/exist',
|
||||
});
|
||||
@@ -119,7 +122,10 @@ test('requirePlugin returns null for invalid requires', () => {
|
||||
test('requirePlugin loads plugin', () => {
|
||||
const name = 'pluginID';
|
||||
const homepage = 'https://fb.workplace.com/groups/flippersupport/';
|
||||
const plugin = requirePlugin([], require)({
|
||||
const plugin = requirePlugin(
|
||||
[],
|
||||
require,
|
||||
)({
|
||||
name,
|
||||
homepage,
|
||||
out: path.join(__dirname, 'TestPlugin.js'),
|
||||
|
||||
@@ -115,9 +115,7 @@ export default (store: Store, logger: Logger) => {
|
||||
if (err.message === 'Connection closed') {
|
||||
// adb server has shutdown, remove all android devices
|
||||
const {connections} = store.getState();
|
||||
const deviceIDsToRemove: Array<
|
||||
string
|
||||
> = connections.devices
|
||||
const deviceIDsToRemove: Array<string> = connections.devices
|
||||
.filter(
|
||||
(device: BaseDevice) => device instanceof AndroidDevice,
|
||||
)
|
||||
|
||||
@@ -24,9 +24,7 @@ export {PluginClient, Props} from './plugin';
|
||||
export {default as Client} from './Client';
|
||||
export {MetricType} from './utils/exportMetrics';
|
||||
export {clipboard} from 'electron';
|
||||
export {
|
||||
default as SupportRequestFormManager,
|
||||
} from './fb-stubs/SupportRequestFormManager';
|
||||
export {default as SupportRequestFormManager} from './fb-stubs/SupportRequestFormManager';
|
||||
export {default as constants} from './fb-stubs/constants';
|
||||
export {connect} from 'react-redux';
|
||||
export {selectPlugin, StaticView} from './reducers/connections';
|
||||
@@ -35,9 +33,7 @@ export {getPluginKey, getPersistedState} from './utils/pluginUtils';
|
||||
export {Idler} from './utils/Idler';
|
||||
export {Store, MiddlewareAPI} from './reducers/index';
|
||||
export {default as BaseDevice} from './devices/BaseDevice';
|
||||
export {
|
||||
default as SidebarExtensions,
|
||||
} from './fb-stubs/LayoutInspectorSidebarExtensions';
|
||||
export {default as SidebarExtensions} from './fb-stubs/LayoutInspectorSidebarExtensions';
|
||||
export {
|
||||
DeviceLogListener,
|
||||
DeviceLogEntry,
|
||||
@@ -55,9 +51,7 @@ export {default as KaiOSDevice} from './devices/KaiOSDevice';
|
||||
export {OS} from './devices/BaseDevice';
|
||||
export {default as Button} from './ui/components/Button';
|
||||
export {default as ToggleButton} from './ui/components/ToggleSwitch';
|
||||
export {
|
||||
default as ButtonNavigationGroup,
|
||||
} from './ui/components/ButtonNavigationGroup';
|
||||
export {default as ButtonNavigationGroup} from './ui/components/ButtonNavigationGroup';
|
||||
export {default as ButtonGroup} from './ui/components/ButtonGroup';
|
||||
export {default as ButtonGroupChain} from './ui/components/ButtonGroupChain';
|
||||
export {colors, darkColors, brandColors} from './ui/components/colors';
|
||||
@@ -90,15 +84,9 @@ export {
|
||||
DataValueExtractor,
|
||||
DataInspectorExpanded,
|
||||
} from './ui/components/data-inspector/DataInspector';
|
||||
export {
|
||||
default as DataInspector,
|
||||
} from './ui/components/data-inspector/DataInspector';
|
||||
export {
|
||||
default as ManagedDataInspector,
|
||||
} from './ui/components/data-inspector/ManagedDataInspector';
|
||||
export {
|
||||
default as DataDescription,
|
||||
} from './ui/components/data-inspector/DataDescription';
|
||||
export {default as DataInspector} from './ui/components/data-inspector/DataInspector';
|
||||
export {default as ManagedDataInspector} from './ui/components/data-inspector/ManagedDataInspector';
|
||||
export {default as DataDescription} from './ui/components/data-inspector/DataDescription';
|
||||
export {default as Tabs} from './ui/components/Tabs';
|
||||
export {default as Tab} from './ui/components/Tab';
|
||||
export {default as Input} from './ui/components/Input';
|
||||
@@ -114,9 +102,7 @@ export {default as Interactive} from './ui/components/Interactive';
|
||||
export {default as Orderable} from './ui/components/Orderable';
|
||||
export {default as VirtualList} from './ui/components/VirtualList';
|
||||
export {Component, PureComponent} from 'react';
|
||||
export {
|
||||
default as ContextMenuProvider,
|
||||
} from './ui/components/ContextMenuProvider';
|
||||
export {default as ContextMenuProvider} from './ui/components/ContextMenuProvider';
|
||||
export {default as ContextMenu} from './ui/components/ContextMenu';
|
||||
export {FileListFile, FileListFiles} from './ui/components/FileList';
|
||||
export {default as FileList} from './ui/components/FileList';
|
||||
@@ -162,12 +148,8 @@ export {
|
||||
SearchableProps,
|
||||
default as Searchable,
|
||||
} from './ui/components/searchable/Searchable';
|
||||
export {
|
||||
default as SearchableTable,
|
||||
} from './ui/components/searchable/SearchableTable';
|
||||
export {
|
||||
default as SearchableTable_immutable,
|
||||
} from './ui/components/searchable/SearchableTable_immutable';
|
||||
export {default as SearchableTable} from './ui/components/searchable/SearchableTable';
|
||||
export {default as SearchableTable_immutable} from './ui/components/searchable/SearchableTable_immutable';
|
||||
export {
|
||||
ElementID,
|
||||
ElementData,
|
||||
@@ -176,12 +158,8 @@ export {
|
||||
ElementSearchResultSet,
|
||||
} from './ui/components/elements-inspector/ElementsInspector';
|
||||
export {Elements} from './ui/components/elements-inspector/elements';
|
||||
export {
|
||||
ContextMenuExtension,
|
||||
} from './ui/components/elements-inspector/elements';
|
||||
export {
|
||||
default as ElementsInspector,
|
||||
} from './ui/components/elements-inspector/ElementsInspector';
|
||||
export {ContextMenuExtension} from './ui/components/elements-inspector/elements';
|
||||
export {default as ElementsInspector} from './ui/components/elements-inspector/ElementsInspector';
|
||||
export {InspectorSidebar} from './ui/components/elements-inspector/sidebar';
|
||||
export {Console} from './ui/components/console';
|
||||
export {default as Sheet} from './ui/components/Sheet';
|
||||
|
||||
@@ -82,12 +82,10 @@ export abstract class FlipperBasePlugin<
|
||||
static icon: string | null = null;
|
||||
static gatekeeper: string | null = null;
|
||||
static entry: string | null = null;
|
||||
static bugs:
|
||||
| ({
|
||||
static bugs: {
|
||||
email?: string;
|
||||
url?: string;
|
||||
})
|
||||
| null = null;
|
||||
} | null = null;
|
||||
static keyboardActions: KeyboardActions | null;
|
||||
static screenshot: string | null;
|
||||
static defaultPersistedState: any;
|
||||
|
||||
@@ -41,8 +41,7 @@ function mockPersistedState(
|
||||
},
|
||||
];
|
||||
|
||||
const imagesMap = imageSizes.reduce(
|
||||
(acc, val, index) => {
|
||||
const imagesMap = imageSizes.reduce((acc, val, index) => {
|
||||
acc[index] = {
|
||||
imageId: String(index),
|
||||
width: val.width,
|
||||
@@ -51,9 +50,7 @@ function mockPersistedState(
|
||||
data: 'undefined',
|
||||
};
|
||||
return acc;
|
||||
},
|
||||
{} as ImagesMap,
|
||||
);
|
||||
}, {} as ImagesMap);
|
||||
|
||||
return {
|
||||
surfaceList: new Set(),
|
||||
@@ -233,8 +230,7 @@ test('the metric reducer with the multiple events', () => {
|
||||
height: 300,
|
||||
},
|
||||
];
|
||||
const imagesMap = imageSizes.reduce(
|
||||
(acc, val, index) => {
|
||||
const imagesMap = imageSizes.reduce((acc, val, index) => {
|
||||
acc[index] = {
|
||||
imageId: String(index),
|
||||
width: val.width,
|
||||
@@ -243,9 +239,7 @@ test('the metric reducer with the multiple events', () => {
|
||||
data: 'undefined',
|
||||
};
|
||||
return acc;
|
||||
},
|
||||
{} as ImagesMap,
|
||||
);
|
||||
}, {} as ImagesMap);
|
||||
const persistedState = {
|
||||
surfaceList: new Set<string>(),
|
||||
images: [],
|
||||
|
||||
@@ -110,7 +110,6 @@ export default class FlipperImagesPlugin extends FlipperPlugin<
|
||||
if (!store) {
|
||||
return defaultPromise;
|
||||
}
|
||||
const selectedDevice = store.getState().connections.selectedDevice;
|
||||
return Promise.all([
|
||||
callClient('listImages'),
|
||||
callClient('getAllImageEventsInfo'),
|
||||
@@ -244,7 +243,7 @@ export default class FlipperImagesPlugin extends FlipperPlugin<
|
||||
}: PersistedState): Array<Notification> =>
|
||||
closeableReferenceLeaks
|
||||
.filter(_ => isLeakTrackingEnabled)
|
||||
.map((event: AndroidCloseableReferenceLeakEvent, index) => ({
|
||||
.map((event: AndroidCloseableReferenceLeakEvent) => ({
|
||||
id: event.identityHashCode,
|
||||
title: `Leaked CloseableReference: ${event.className}`,
|
||||
message: (
|
||||
|
||||
@@ -19,7 +19,6 @@ import {DeviceLogEntry} from '../../devices/BaseDevice';
|
||||
|
||||
import {
|
||||
Text,
|
||||
ManagedTable,
|
||||
ManagedTableClass,
|
||||
Button,
|
||||
colors,
|
||||
|
||||
@@ -53,7 +53,7 @@ export default class extends FlipperPlugin<State, any, PersistedState> {
|
||||
|
||||
state = {
|
||||
shouldShowSaveBookmarkDialog: false,
|
||||
saveBookmarkURI: null as (string | null),
|
||||
saveBookmarkURI: null as string | null,
|
||||
shouldShowURIErrorDialog: false,
|
||||
requiredParameters: [],
|
||||
};
|
||||
|
||||
@@ -9,15 +9,7 @@
|
||||
|
||||
import type {SectionComponentHierarchy} from './Models';
|
||||
|
||||
import {
|
||||
Button,
|
||||
Glyph,
|
||||
PureComponent,
|
||||
styled,
|
||||
Toolbar,
|
||||
Spacer,
|
||||
colors,
|
||||
} from 'flipper';
|
||||
import {Glyph, PureComponent, styled, Toolbar, Spacer, colors} from 'flipper';
|
||||
import {Tree} from 'react-d3-tree';
|
||||
import {Fragment} from 'react';
|
||||
|
||||
|
||||
@@ -12,12 +12,7 @@ import {
|
||||
registerPlugins,
|
||||
addGatekeepedPlugins,
|
||||
} from '../plugins';
|
||||
import {
|
||||
FlipperBasePlugin,
|
||||
FlipperPlugin,
|
||||
FlipperDevicePlugin,
|
||||
BaseAction,
|
||||
} from '../../plugin';
|
||||
import {FlipperPlugin, FlipperDevicePlugin, BaseAction} from '../../plugin';
|
||||
|
||||
const testPlugin = class extends FlipperPlugin<any, BaseAction, any> {
|
||||
static id = 'TestPlugin';
|
||||
|
||||
@@ -260,7 +260,10 @@ const diffMetadataExtractor: DiffMetadataExtractor = (
|
||||
// Check if there's a difference between the original value and
|
||||
// the value from the diff prop
|
||||
// The property name still exists, but the values may be different.
|
||||
return [{data: val, status: 'added'}, {data: diffVal, status: 'removed'}];
|
||||
return [
|
||||
{data: val, status: 'added'},
|
||||
{data: diffVal, status: 'removed'},
|
||||
];
|
||||
}
|
||||
|
||||
return Object.prototype.hasOwnProperty.call(data, key) ? [{data: val}] : [];
|
||||
|
||||
@@ -105,8 +105,8 @@ export default class FilterToken extends PureComponent<Props> {
|
||||
onMouseDown = () => {
|
||||
if (
|
||||
this.props.filter.type !== 'enum' ||
|
||||
(this.props.filter.persistent == null ||
|
||||
this.props.filter.persistent === false)
|
||||
this.props.filter.persistent == null ||
|
||||
this.props.filter.persistent === false
|
||||
) {
|
||||
this.props.onFocus(this.props.index);
|
||||
}
|
||||
|
||||
@@ -10,9 +10,7 @@
|
||||
export {default as styled} from 'react-emotion';
|
||||
export {default as Button} from './components/Button';
|
||||
export {default as ToggleButton} from './components/ToggleSwitch';
|
||||
export {
|
||||
default as ButtonNavigationGroup,
|
||||
} from './components/ButtonNavigationGroup';
|
||||
export {default as ButtonNavigationGroup} from './components/ButtonNavigationGroup';
|
||||
export {default as ButtonGroup} from './components/ButtonGroup';
|
||||
export {default as ButtonGroupChain} from './components/ButtonGroupChain';
|
||||
|
||||
@@ -39,12 +37,8 @@ export {
|
||||
} from './components/table/types';
|
||||
export {default as ManagedTable} from './components/table/ManagedTable';
|
||||
export {ManagedTableProps} from './components/table/ManagedTable';
|
||||
export {
|
||||
default as ManagedTable_immutable,
|
||||
} from './components/table/ManagedTable_immutable';
|
||||
export {
|
||||
ManagedTableProps_immutable,
|
||||
} from './components/table/ManagedTable_immutable';
|
||||
export {default as ManagedTable_immutable} from './components/table/ManagedTable_immutable';
|
||||
export {ManagedTableProps_immutable} from './components/table/ManagedTable_immutable';
|
||||
|
||||
export {Value} from './components/table/TypeBasedValueRenderer';
|
||||
export {renderValue} from './components/table/TypeBasedValueRenderer';
|
||||
@@ -53,15 +47,9 @@ export {
|
||||
DataValueExtractor,
|
||||
DataInspectorExpanded,
|
||||
} from './components/data-inspector/DataInspector';
|
||||
export {
|
||||
default as DataInspector,
|
||||
} from './components/data-inspector/DataInspector';
|
||||
export {
|
||||
default as ManagedDataInspector,
|
||||
} from './components/data-inspector/ManagedDataInspector';
|
||||
export {
|
||||
default as DataDescription,
|
||||
} from './components/data-inspector/DataDescription';
|
||||
export {default as DataInspector} from './components/data-inspector/DataInspector';
|
||||
export {default as ManagedDataInspector} from './components/data-inspector/ManagedDataInspector';
|
||||
export {default as DataDescription} from './components/data-inspector/DataDescription';
|
||||
|
||||
// tabs
|
||||
export {default as Tabs} from './components/Tabs';
|
||||
@@ -151,12 +139,8 @@ export {
|
||||
SearchIcon,
|
||||
default as Searchable,
|
||||
} from './components/searchable/Searchable';
|
||||
export {
|
||||
default as SearchableTable,
|
||||
} from './components/searchable/SearchableTable';
|
||||
export {
|
||||
default as SearchableTable_immutable,
|
||||
} from './components/searchable/SearchableTable_immutable';
|
||||
export {default as SearchableTable} from './components/searchable/SearchableTable';
|
||||
export {default as SearchableTable_immutable} from './components/searchable/SearchableTable_immutable';
|
||||
export {SearchableProps} from './components/searchable/Searchable';
|
||||
|
||||
export {
|
||||
@@ -168,9 +152,7 @@ export {
|
||||
} from './components/elements-inspector/ElementsInspector';
|
||||
export {Elements} from './components/elements-inspector/elements';
|
||||
export {ContextMenuExtension} from './components/elements-inspector/elements';
|
||||
export {
|
||||
default as ElementsInspector,
|
||||
} from './components/elements-inspector/ElementsInspector';
|
||||
export {default as ElementsInspector} from './components/elements-inspector/ElementsInspector';
|
||||
export {InspectorSidebar} from './components/elements-inspector/sidebar';
|
||||
|
||||
export {Console} from './components/console';
|
||||
|
||||
@@ -203,8 +203,11 @@ export default class CertificateProvider {
|
||||
const deviceIdPromise = appNamePromise.then(app =>
|
||||
this.getTargetAndroidDeviceId(app, destination, csr),
|
||||
);
|
||||
return Promise.all([deviceIdPromise, appNamePromise, this.adb]).then(
|
||||
([deviceId, appName, adbClient]) =>
|
||||
return Promise.all([
|
||||
deviceIdPromise,
|
||||
appNamePromise,
|
||||
this.adb,
|
||||
]).then(([deviceId, appName, adbClient]) =>
|
||||
androidUtil.push(
|
||||
adbClient,
|
||||
deviceId,
|
||||
|
||||
@@ -65,11 +65,17 @@ test('test makeObjectSerializable and deserializeObject function for nested obje
|
||||
});
|
||||
|
||||
test('test makeObjectSerializable and deserializeObject function for Map and Set with no nesting', async () => {
|
||||
const map = new Map([['k1', 'v1'], ['k2', 'v2']]);
|
||||
const map = new Map([
|
||||
['k1', 'v1'],
|
||||
['k2', 'v2'],
|
||||
]);
|
||||
const output = await makeObjectSerializable(map);
|
||||
const expected = {
|
||||
__flipper_object_type__: 'Map',
|
||||
data: [['k1', 'v1'], ['k2', 'v2']],
|
||||
data: [
|
||||
['k1', 'v1'],
|
||||
['k2', 'v2'],
|
||||
],
|
||||
};
|
||||
expect(output).toEqual(expected);
|
||||
expect(deserializeObject(output)).toEqual(map);
|
||||
@@ -92,7 +98,10 @@ test('test makeObjectSerializable and deserializeObject function for Map and Set
|
||||
const output = await makeObjectSerializable(map);
|
||||
const expected = {
|
||||
__flipper_object_type__: 'Map',
|
||||
data: [[{title: 'k1'}, {title: 'v1'}], [{title: 'k2'}, {title: 'v2'}]],
|
||||
data: [
|
||||
[{title: 'k1'}, {title: 'v1'}],
|
||||
[{title: 'k2'}, {title: 'v2'}],
|
||||
],
|
||||
};
|
||||
expect(output).toEqual(expected);
|
||||
expect(deserializeObject(output)).toEqual(map);
|
||||
@@ -134,14 +143,20 @@ test('test makeObjectSerializable and deserializeObject function for custom Obje
|
||||
|
||||
const nestedObjWithMap = new TestObject(
|
||||
{title: 'nestedTitle'},
|
||||
new Map([['k1', 'v1'], ['k2', 'v2']]),
|
||||
new Map([
|
||||
['k1', 'v1'],
|
||||
['k2', 'v2'],
|
||||
]),
|
||||
);
|
||||
const nestedObjWithMapOutput = await makeObjectSerializable(nestedObjWithMap);
|
||||
const expectedNestedObjWithMapOutput = {
|
||||
title: {title: 'nestedTitle'},
|
||||
map: {
|
||||
__flipper_object_type__: 'Map',
|
||||
data: [['k1', 'v1'], ['k2', 'v2']],
|
||||
data: [
|
||||
['k1', 'v1'],
|
||||
['k2', 'v2'],
|
||||
],
|
||||
},
|
||||
set: undefined,
|
||||
};
|
||||
@@ -150,7 +165,10 @@ test('test makeObjectSerializable and deserializeObject function for custom Obje
|
||||
|
||||
const nestedObjWithMapSet = new TestObject(
|
||||
{title: 'nestedTitle'},
|
||||
new Map([['k1', 'v1'], ['k2', 'v2']]),
|
||||
new Map([
|
||||
['k1', 'v1'],
|
||||
['k2', 'v2'],
|
||||
]),
|
||||
new Set([
|
||||
{title: '1'},
|
||||
{title: '2'},
|
||||
@@ -167,7 +185,10 @@ test('test makeObjectSerializable and deserializeObject function for custom Obje
|
||||
title: {title: 'nestedTitle'},
|
||||
map: {
|
||||
__flipper_object_type__: 'Map',
|
||||
data: [['k1', 'v1'], ['k2', 'v2']],
|
||||
data: [
|
||||
['k1', 'v1'],
|
||||
['k2', 'v2'],
|
||||
],
|
||||
},
|
||||
set: {
|
||||
__flipper_object_type__: 'Set',
|
||||
@@ -194,28 +215,52 @@ test('test makeObjectSerializable and deserializeObject function for Array as in
|
||||
expect(deserializeObject(output)).toEqual(arr);
|
||||
|
||||
const arrMap = [
|
||||
new Map([['a1', 'v1'], ['a2', 'v2']]),
|
||||
new Map([['b1', 'v1'], ['b2', 'v2']]),
|
||||
new Map([['c1', 'v1'], ['c2', 'v2']]),
|
||||
new Map([['d1', 'v1'], ['d2', 'v2']]),
|
||||
new Map([
|
||||
['a1', 'v1'],
|
||||
['a2', 'v2'],
|
||||
]),
|
||||
new Map([
|
||||
['b1', 'v1'],
|
||||
['b2', 'v2'],
|
||||
]),
|
||||
new Map([
|
||||
['c1', 'v1'],
|
||||
['c2', 'v2'],
|
||||
]),
|
||||
new Map([
|
||||
['d1', 'v1'],
|
||||
['d2', 'v2'],
|
||||
]),
|
||||
];
|
||||
|
||||
const expectedArr = [
|
||||
{
|
||||
__flipper_object_type__: 'Map',
|
||||
data: [['a1', 'v1'], ['a2', 'v2']],
|
||||
data: [
|
||||
['a1', 'v1'],
|
||||
['a2', 'v2'],
|
||||
],
|
||||
},
|
||||
{
|
||||
__flipper_object_type__: 'Map',
|
||||
data: [['b1', 'v1'], ['b2', 'v2']],
|
||||
data: [
|
||||
['b1', 'v1'],
|
||||
['b2', 'v2'],
|
||||
],
|
||||
},
|
||||
{
|
||||
__flipper_object_type__: 'Map',
|
||||
data: [['c1', 'v1'], ['c2', 'v2']],
|
||||
data: [
|
||||
['c1', 'v1'],
|
||||
['c2', 'v2'],
|
||||
],
|
||||
},
|
||||
{
|
||||
__flipper_object_type__: 'Map',
|
||||
data: [['d1', 'v1'], ['d2', 'v2']],
|
||||
data: [
|
||||
['d1', 'v1'],
|
||||
['d2', 'v2'],
|
||||
],
|
||||
},
|
||||
];
|
||||
const outputMap = await makeObjectSerializable(arrMap);
|
||||
@@ -269,7 +314,10 @@ test('test makeObjectSerializable and deserializeObject function for Map of Sets
|
||||
test('test makeObjectSerializable and deserializeObject function for Map, Dates and Set with complex nesting', async () => {
|
||||
const date1 = new Date('2019-02-15');
|
||||
const date2 = new Date('2019-02-16');
|
||||
const map = new Map([['k1', date1], ['k2', new Set([date2])]]);
|
||||
const map = new Map([
|
||||
['k1', date1],
|
||||
['k2', new Set([date2])],
|
||||
]);
|
||||
const expectedOutput = {
|
||||
__flipper_object_type__: 'Map',
|
||||
data: [
|
||||
|
||||
@@ -61,7 +61,7 @@ export function _push(
|
||||
deviceId,
|
||||
app,
|
||||
`echo "${contents}" > '${filename}' && chmod 644 '${filename}'`,
|
||||
).then(output => undefined);
|
||||
).then(_ => undefined);
|
||||
}
|
||||
|
||||
export function _pull(
|
||||
|
||||
@@ -24,7 +24,7 @@ declare global {
|
||||
|
||||
__REDUX_DEVTOOLS_EXTENSION__:
|
||||
| undefined
|
||||
| StoreEnhancerStoreCreator & StoreEnhancerStateSanitizer;
|
||||
| (StoreEnhancerStoreCreator & StoreEnhancerStateSanitizer);
|
||||
|
||||
Flipper: {
|
||||
init: () => void;
|
||||
|
||||
Reference in New Issue
Block a user