diff --git a/lib/utils/objects.js b/lib/utils/objects.js --- a/lib/utils/objects.js +++ b/lib/utils/objects.js @@ -40,18 +40,11 @@ function values(map: ObjectMap): T[] { return Object.values - ? // https://github.com/facebook/flow/issues/2221 - // $FlowFixMe - Object.values currently does not have good flow support - Object.values(map) + ? Object.values(map) : Object.keys(map).map((key: K): T => map[key]); } -function keys(map: ObjectMap): K[] { - return Object.keys(map); -} - function entries(map: ObjectMap): [K, T][] { - // $FlowFixMe - flow treats the values as mixed, but we know that they are T return Object.entries(map); } @@ -87,7 +80,7 @@ obj2: NestedObjectMap, ): NestedObjectMap { let diff: NestedObjectMap = {}; - keys(obj1).forEach((key: K) => { + Object.keys(obj1).forEach((key: K) => { if (_isEqual(obj1[key], obj2[key])) { return; } @@ -112,7 +105,7 @@ processedObject: ObjectMap, expectedObject: ObjectMap, message: string, -) { +): void { if (_isEqual(processedObject)(expectedObject)) { return; }