UNPKG

object-str-find

Version:

Find substring or match regexp in the object and his inner objects.

13 lines (11 loc) 311 B
const appendNewItemToResults = (results, item) => { const { path } = item if (results.has(path)) { const current = results.get(path) current.found = current.found.concat(item.found) results.set(path, current) } else { results.set(path, item) } } module.exports = appendNewItemToResults