Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const contacts = [
- {
- firstName: "johan",
- lastName: "Villamil"
- },
- {
- firstName: "andres",
- lastName: "rosero"
- },
- {
- firstName: "nicolas",
- lastName: "rodriguez"
- },
- {
- firstName: "otro",
- lastName: "Villa"
- },
- ]
- const filterObjectBy = curry((value, attrs, data) => filter(
- compose(
- contains(toUpper(value)),
- compose(
- join(' '),
- map(toUpper),
- props(attrs)
- )
- )
- )(data))
- filterObjectBy('vill', ['firstName', 'lastName'], contacts)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement