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)

enhancement

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: nobody → oss
Blocks: 1466494
Status: NEW → ASSIGNED
Priority: -- → P3
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]
Attachment #8985078 - Flags: review?(cdawson)
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)
Attachment #8985078 - Flags: review?(cdawson)
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 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+
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.

Attachment

General

Created:
Updated:
Size: