Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Reduce dependency on lodash functions: includes, uniq, repeat, isinte…
…ger (#11790) * Replace lodash 'includes' usage with Array.prototype.includes * Replace lodash 'values' usage with Object.values * Replace lodash 'uniq' usage with Array.from(new Set(...)) * Property safety: ensure that ignoreSuites/ignoreTasks are populated prior to access * Property safety: ensure that blacklistTypes is populated prior to access * Revert "Replace lodash 'values' usage with Object.values" This reverts commit 9fd3679. * Replace lodash 'repeat' usage with String.prototype.repeat * Replace lodash 'isinteger' usage with Number.isInteger * Remove explicit lodash dependency from babel-generator package * Update packages/babel-helper-transform-fixture-test-runner/src/index.js Co-authored-by: Brian Ng <bng412@gmail.com> * Rely on optional chaining operator as sole boolean check * Handle additional optional chaining operator simplification * Update type signature Co-authored-by: Brian Ng <bng412@gmail.com>
- Loading branch information
1 parent
c664fbd
commit 3e55270
Showing
9 changed files
with
17 additions
and
27 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
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
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 |
---|---|---|
@@ -1,12 +1,12 @@ | ||
// @flow | ||
import uniq from "lodash/uniq"; | ||
|
||
export default function inherit( | ||
key: string, | ||
child: Object, | ||
parent: Object, | ||
): void { | ||
if (child && parent) { | ||
child[key] = uniq([].concat(child[key], parent[key]).filter(Boolean)); | ||
child[key] = Array.from( | ||
new Set([].concat(child[key], parent[key]).filter(Boolean)), | ||
); | ||
} | ||
} |