New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use native or lodash util module where full "lodash" is required #5042
Conversation
Current coverage is 89.20% (diff: 86.36%)@@ master #5042 diff @@
==========================================
Files 203 203
Lines 9821 9819 -2
Methods 1071 1071
Messages 0 0
Branches 2615 2615
==========================================
- Hits 8761 8759 -2
Misses 1060 1060
Partials 0 0
|
@@ -159,7 +162,7 @@ export default function ( | |||
sourceMap: !!(task.sourceMappings || task.sourceMap), | |||
}); | |||
|
|||
_.extend(task.options, taskOpts); | |||
extend(task.options, taskOpts); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Object.assign
, or is it intended that taskOpts
prototype keys are copied? How do you even get things in taskOpts
' prototype since it comes from JSON?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know if it's intended
for taskOpts
prototype keys to be copied, so I'm doing the safe thing here and maintaining the exact same behavior. If this PR is merged, then I'll do another pass at removing some of these utils like in #5043.
let cloneDeep = require("lodash/cloneDeep"); | ||
let traverse = require("../lib").default; | ||
let assert = require("assert"); | ||
let parse = require("babylon").parse; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
These could all be const
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I also could've used arrow functions for the forEach
's but I didn't because that's not what this PR is about.
This PR ports all of the use sites of full
lodash
to either using the piecemeal utility modules or their native equivalents.