2.1.0 • Published 8 years ago
object-contains-deep v2.1.0
object-contains-deep
Checks if the haystack object contains needle object
Install
npm install object-contains-deep
usage
var contains = require('object-contains-deep');
contains({ val:42, name: 'batman' }, {val: 42}); // true
It search the needle as deep as you want, and takes care of all the edge cases which come to my mind (feel free to give a look at the test cases):
contains({ val:42, some: { thing: { deep: [1,2,3] } } }, { some: { thing: { deep: [1,2,3] } } }); // true
##ECMAScript 2015 module
object-contains-deep
is written as an ECMAScript2015 module; it could be used in the browser using a module loader such as jspm, or transpiled to commonjs module format in order to be used in nodejs.