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

chore: add omit utility #909

Merged
merged 1 commit into from
Oct 21, 2024
Merged

chore: add omit utility #909

merged 1 commit into from
Oct 21, 2024

Conversation

EvanHahn
Copy link
Contributor

This PR is not urgent.

This change should have no impact on functionality.

This replaces the following pattern:

// eslint-disable-next-line no-unused-vars
const { foo, bar, ...rest } = obj
return rest

With a new omit utility, which I think is clearer:

return omit(obj, ['foo', 'bar'])

I think this is a useful change on its own, but also makes an upcoming change slightly easier because I wanted this function.

This change should have no impact on functionality.

This replaces the following pattern:

```javascript
// eslint-disable-next-line no-unused-vars
const { foo, bar, ...rest } = obj
return rest
```

With a new `omit` utility, which I think is clearer:

```javascript
return omit(obj, ['foo', 'bar'])
```

I think this is a useful change on its own, but also makes an upcoming
change slightly easier because I wanted this function.
@EvanHahn EvanHahn requested a review from achou11 October 17, 2024 22:10
src/config-import.js Show resolved Hide resolved
src/mapeo-manager.js Show resolved Hide resolved
src/mapeo-manager.js Show resolved Hide resolved
test/translation-api.js Show resolved Hide resolved
Copy link
Member

@achou11 achou11 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm! seeing this reminds me of https://github.com/toss/es-toolkit, which maybe isn't necessary for us anytime soon, but could be worth considering if we keep adding things like this.

@EvanHahn EvanHahn merged commit 2da2a2a into main Oct 21, 2024
6 checks passed
@EvanHahn EvanHahn deleted the omit branch October 21, 2024 14:19
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.

2 participants