Page Menu
Home
Phabricator
Search
Configure Global Search
Log In
Files
F3179902
D9712.id32716.diff
No One
Temporary
Actions
View File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
1 KB
Referenced Files
None
Subscribers
None
D9712.id32716.diff
View Options
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<K, T>(map: ObjectMap<K, T>): 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<K, T>(map: ObjectMap<K, T>): K[] {
- return Object.keys(map);
-}
-
function entries<K: string, T>(map: ObjectMap<K, T>): [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<K, T>,
): NestedObjectMap<K, T> {
let diff: NestedObjectMap<K, T> = {};
- keys(obj1).forEach((key: K) => {
+ Object.keys(obj1).forEach((key: K) => {
if (_isEqual(obj1[key], obj2[key])) {
return;
}
@@ -112,7 +105,7 @@
processedObject: ObjectMap<K, T>,
expectedObject: ObjectMap<K, T>,
message: string,
-) {
+): void {
if (_isEqual(processedObject)(expectedObject)) {
return;
}
File Metadata
Details
Attached
Mime Type
text/plain
Expires
Sat, Nov 9, 3:46 AM (17 h, 59 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
2448339
Default Alt Text
D9712.id32716.diff (1 KB)
Attached To
Mode
D9712: [Flow202][lib][skip-ci] [20/23] Get rid of $FlowFixMes in lib/utils/objects.js
Attached
Detach File
Event Timeline
Log In to Comment