-
Notifications
You must be signed in to change notification settings - Fork 2.1k
remove some lodash calls #3950
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
Open
dynst
wants to merge
14
commits into
bitpay:master
Choose a base branch
from
dynst:lodash-removal-1
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
remove some lodash calls #3950
Conversation
This file contains hidden or 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
find packages/ -type f \( -name "*.js" \) -exec sed -i -E \ -e 's/_.includes\(([^,]+),[[:space:]]*([^)]+)\)/\1.includes(\2)/g' {} +
find packages/ -type f -name '*.js' -exec sed -i -E \ -e 's/_\.takeRight\(([^,]+), ([0-9])\)/\1.slice(-\2)/g' {} +
find packages/ -type f -name '*.js' -exec sed -i -E \ -e 's/_\.each\(([^,]+), function\(([^\)]*)\) \{/\1.forEach((\2) => {/g' {} + find packages/ -type f -name '*.js' -exec sed -i -E \ -e 's/_\.each\((\[[^]]+\]), function\(([^\)]*)\) \{/\1.forEach((\2) => {/g' {} +
find packages/ -type f -exec sed -i -E \ -e 's/_\.without\(([^,]+), ([^,\)]+)\)/\1.filter(x => x !== \2)/g' {} +
2bcf94b
to
9b109ea
Compare
find packages/ -type f -exec sed -i -E \ -e 's/_\.every\(([^,]+), function\(([a-zA-Z]+)\) \{/\1.every(\2 => \{/g' {} + find packages/ -type f -exec sed -i -E \ -e 's/_\.every\(([^,]+), ([^,\)]+)\)/\1.every(\2)/g' {} +
find packages/ -type f -exec sed -i -E \ -e 's/_\.map\(([^,]+), function\(([^,\)]*)\) \{/\1.map(\2 => {/g' {} + find packages/ -type f -exec sed -i -E \ -e 's/_\.map\(([^,]+), function(\([^\)]*\)) \{/\1.map(\2 => {/g' {} + find packages/ -type f -exec sed -i -E \ -e 's/_[.]map\(([^,]+), ([a-zA-Z]+) => \{/\1.map(\2 => {/g' {} + find packages/ -type f -exec sed -i -E \ -e 's/_[.]map\(([^,]+), ([a-zA-Z]+ => [^\{])/\1.map(\2/g' {} +
find packages/ -type f -exec sed -i -E \ -e 's/_\.filter\(([^,]+), function\(([a-zA-Z]+)\) \{/\1.filter(\2 => \{/g' {} + find packages/ -type f -exec sed -i -E \ -e 's/_\.filter\(([^,]+), (.* => \{)/\1.filter(\2/g' {} +
find packages/ -type f -exec sed -i -E \ -e 's/!_\.isEmpty\(([a-zA-Z.]+)\)/\1.length !== 0/g' {} + find packages/ -type f -exec sed -i -E \ -e 's/_\.isEmpty\(([a-zA-Z.]+)\)/\1.length === 0/g' {} +
6a1c1ec
to
aca1d55
Compare
6ba9604
to
50cc7bb
Compare
Thanks for the PR @dynst . Before I can merge anything, you'll need to resolve the merge conflict and sign all your commits per the contributing guidelines. Additionally, here are a few notes regarding the work:
|
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
#3949
Excluding isString, isUndefined, isObject, and things like that (which don't have to be removed, if lodash can be replaced with
var _ = require('is-what')
), there are fewer than 50 lines using lodash in the library code after this PR. (There's much more than that in the tests.)