Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- obj = {eins: 'one', zwei: 'two'}
- queryA = {eins: 'one'}
- queryB = {eins: 'one', zwei: 'deux'}
- matcher(obj, queryA) // true
- matcher(obj, queryB) // false
- const matcher = curryRight(
- (state, query) =>
- flowRight([
- every(Boolean),
- map(
- (val, key) => {
- return state[key] && state[key].match(new RegExp(val, 'ig'))
- }
- )
- ])(query)
- )
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement