Closed
Bug 1468164
Opened 7 years ago
Closed 7 years ago
Convert lodash .intersection() & _.difference() to native ES6 JS
Categories
(Tree Management :: Treeherder: Frontend, enhancement, P3)
Tree Management
Treeherder: Frontend
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: evct, Assigned: evct, Mentored)
References
Details
Attachments
(1 file)
Converting all _.intersection() & _.difference (lodash) functions to ES6 JS
Assignee | ||
Updated•7 years ago
|
Assignee | ||
Comment 1•7 years ago
|
||
This should do it (I haven't tested it yet):
const e = [2,1];
const f = [2,3];
const intersection = Array.from(new Set(e.filter(x => f.includes(x))));
console.log(intersection);
// [2]
const g = [2,1];
const h = [2,3];
const difference = Array.from(new Set(g.filter(x => !h.includes(x))));
console.log(difference);
// [1]
Comment 2•7 years ago
|
||
Updated•7 years ago
|
Attachment #8985078 -
Flags: review?(cdawson)
Comment 3•7 years ago
|
||
Comment on attachment 8985078 [details] [review]
Link to GitHub pull-request: https://github.com/mozilla/treeherder/pull/3656
Left feedback in the PR.
Flags: needinfo?(cdawson)
Attachment #8985078 -
Flags: review?(cdawson)
Assignee | ||
Updated•7 years ago
|
Attachment #8985078 -
Flags: review?(cdawson)
Comment 4•7 years ago
|
||
Commit pushed to master at https://github.com/mozilla/treeherder
https://github.com/mozilla/treeherder/commit/5d9b37e0fb0e24a99a64f2f0b0481eea719717e6
Bug 1468164 - convert _.intersection() & _.difference() usages to ES6 (#3656)
Use single lodash import
Comment 5•7 years ago
|
||
Comment on attachment 8985078 [details] [review]
Link to GitHub pull-request: https://github.com/mozilla/treeherder/pull/3656
Thanks for the updates!
Flags: needinfo?(cdawson)
Attachment #8985078 -
Flags: review?(cdawson) → review+
Updated•7 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 7 years ago
Resolution: --- → FIXED
You need to log in
before you can comment on or make changes to this bug.
Description
•