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

Add u.is #13

Closed
aaronjensen opened this issue Aug 5, 2015 · 1 comment
Closed

Add u.is #13

aaronjensen opened this issue Aug 5, 2015 · 1 comment

Comments

@aaronjensen
Copy link
Member

Works like u.in but simply returns true or false if the predicate is met:

u.is("a.b", 3, { a: { b: 3 } }); // => true
u.is("a.b", 2, { a: { b: 3 } }); // => false
u.is("a.b", isEven, { a: { b: 3 } }); // => false

predicate can be a value or a function. If it's a function, invoke it and use the return value.
path can be a string or an array, just like u.in.

I may have gotten the order of the arguments of u.in and u.is wrong... wondering if value should be first...

@aaronjensen
Copy link
Member Author

5c0855b

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant