Advertisement
Guest User

Untitled

a guest
Jun 16th, 2019
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.48 KB | None | 0 0
  1. const contacts = [
  2. {
  3. firstName: "johan",
  4. lastName: "Villamil"
  5. },
  6. {
  7. firstName: "andres",
  8. lastName: "rosero"
  9. },
  10. {
  11. firstName: "nicolas",
  12. lastName: "rodriguez"
  13. },
  14. {
  15. firstName: "otro",
  16. lastName: "Villa"
  17. },
  18. ]
  19.  
  20. const filterObjectBy = curry((value, attrs, data) => filter(
  21. compose(
  22. contains(toUpper(value)),
  23. compose(
  24. join(' '),
  25. map(toUpper),
  26. props(attrs)
  27. )
  28. )
  29. )(data))
  30.  
  31. filterObjectBy('vill', ['firstName', 'lastName'], contacts)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement