is-subset
Check if an object is contained within another one.
Installation
$ npm install is-subset
Usage
- Import the module:
; // …or:var isSubset = ;
- These are true:
; ; ;
…and these are false:
; ; ;
See the specs for more info.
API
isSubset(superset, subset)
Check if an object is contained within another object.
Returns true
if:
- all enumerable keys of subset are also enumerable in superset, and
- every value assigned to an enumerable key of subset strictly equals the value assigned to the same key of superset – or is a subset of it.
Parameters:
Object
supersetObject
subset
Return value:
Boolean