-
-
Notifications
You must be signed in to change notification settings - Fork 6.5k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
replace getObjectEntries with Object.entries
- Loading branch information
Showing
3 changed files
with
2 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -142,13 +142,6 @@ export const getObjectSubset = ( | |
return object; | ||
}; | ||
|
||
// NOTE: Should be removed after dropping [email protected] support, | ||
// and we should use (Object.entries) | ||
export const getObjectEntries: typeof Object.entries = ( | ||
object: any, | ||
): Array<[string, any]> => | ||
object == null ? [] : Object.keys(object).map(key => [key, object[key]]); | ||
|
||
const IteratorSymbol = Symbol.iterator; | ||
|
||
const hasIterator = (object: any) => | ||
|
@@ -267,8 +260,8 @@ export const iterableEquality = ( | |
return false; | ||
} | ||
|
||
const aEntries = getObjectEntries(a); | ||
const bEntries = getObjectEntries(b); | ||
const aEntries = Object.entries(a); | ||
const bEntries = Object.entries(b); | ||
if (!equals(aEntries, bEntries)) { | ||
return false; | ||
} | ||
|