Skip to content
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

refactor(lodash): Removes most of the lodash dependencies in favor of native js #117

Merged
merged 2 commits into from
Apr 1, 2024

Conversation

acolchado
Copy link
Collaborator

Most of these lodash dependencies have a native replacement. The only reason they seem to have been used was to wrap the natives with safe checks and returns.

For example the use of _forEach(list, () => ...) is a safe version of:

(list || []).forEach((item) => ...);

Lodash protects against undefined, null. Others such as _.map also protect by returning an empty map so that chaining is safely allowed, some es6 doesn't allow native.

… native js

Most of these lodash dependencies have a native replacement. The only reason they seem to have been used was to wrap the natives with safe checks and returns.

For example the use of `_forEach(list, () => ...)` is a safe version of:

```
(list || []).forEach((item) => ...);
```

Lodash protects against undefined, null. Others such as _.map also protect by returning an empty map so that chaining is safely allowed, some es6 doesn't allow native.
@acolchado acolchado merged commit 57c0be5 into main Apr 1, 2024
2 checks passed
@acolchado acolchado deleted the AC/lodash branch April 1, 2024 07:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant