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

objects.filter #213

Closed
3 tasks done
jkvyff opened this issue Jan 14, 2020 · 2 comments
Closed
3 tasks done

objects.filter #213

jkvyff opened this issue Jan 14, 2020 · 2 comments
Labels
enhancement New feature or request operator

Comments

@jkvyff
Copy link
Collaborator

jkvyff commented Jan 14, 2020

Filter iterates over an object and applies a function to each property, for all properties where the function returns true return that property in a new object.

Checklist

  • implementation
  • tests
  • jsdoc

Details

console.log(objects.filter({ small: "ant", medium: "dog", big: "elephant" }, (key, value) => ['small', 'big'].includes(key)));
> { small: 'ant', big: 'elephant' }

References

@jkvyff jkvyff added enhancement New feature or request operator labels Jan 14, 2020
@evanplaice
Copy link
Member

evanplaice commented Jan 14, 2020

Damn, you're fast. I was going to implement this tonight. I'll take care of removing include/exclude instead.

@evanplaice
Copy link
Member

evanplaice commented Jan 15, 2020

Added in v0.81

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request operator
Projects
None yet
Development

No branches or pull requests

2 participants