Advertisement
Guest User

Untitled

a guest
Mar 1st, 2017
57
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.38 KB | None | 0 0
  1. obj = {eins: 'one', zwei: 'two'}
  2. queryA = {eins: 'one'}
  3. queryB = {eins: 'one', zwei: 'deux'}
  4.  
  5. matcher(obj, queryA) // true
  6. matcher(obj, queryB) // false
  7.  
  8. const matcher = curryRight(
  9. (state, query) =>
  10. flowRight([
  11. every(Boolean),
  12. map(
  13. (val, key) => {
  14. return state[key] && state[key].match(new RegExp(val, 'ig'))
  15. }
  16. )
  17. ])(query)
  18. )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement