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
Replace lodash forEach(array) with native Array.forEach #7748
Conversation
6285f3f
to
486ace5
Compare
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.
e4a6416
to
9511532
Compare
Codecov Report
@@ Coverage Diff @@
## master #7748 +/- ##
=======================================
Coverage 88.13% 88.14%
=======================================
Files 245 245
Lines 9262 9261 -1
=======================================
Hits 8163 8163
+ Misses 1099 1098 -1
Continue to review full report at Codecov.
|
@medikoo Ready to re-review. |
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.
@exoego great thanks for update! Still, it appears it now has conflicts, can you fix them?
# Conflicts: # lib/plugins/aws/package/compile/events/cognitoUserPool/index.js
# Conflicts: # lib/plugins/aws/package/compile/events/apiGateway/lib/apiKeys.test.js # lib/plugins/aws/package/compile/events/apiGateway/lib/usagePlanKeys.test.js # lib/plugins/aws/package/compile/functions/index.js # lib/plugins/package/lib/zipService.js
@medikoo Sorry for delay. |
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.
Thank you @exoego !
Adresses #7747
All occurence of
_.forEach(array, e => ...
are replaced with nativearray.forEach(e => ...)
._.forEach(object, (k, v) => ....)
still remains, since there are no native counterpart.(Maybe
Object.entries(obj).forEach(pair => { const [k,v] = pair; ...
, which is verbose)_.each
(alias of_.forEach
) are renamed to_.forEach
.One caveat of native
array.forEach
is null pointer error.If the value is null,
array.forEach
throws NPE.However,
_.forEach(null, ...)
ignores null silently.So we might need
(value || []).forEach
or similar to avoid NPE.