UNPKG

find-where

Version:

Iterates over a collection of values and returns the first value that matches all of the key-value pairs provided.

4 lines (2 loc) 115 B
const { matcher } = require('@jonkemp/package-utils'); module.exports = (obj, attrs) => obj.find(matcher(attrs));