Is-subset

is-subset

Check if an object is contained within another one.

is-subset is a tiny little module that is so very useful! All it does is accepts superSet and maybeSubset objects and check if the maybeSubset is a subset of the superSet.

Get it: npm install --save is-subset

Sample usage:

1
2
3
4
5
6
7
8
9
10
11
12
13
14
const isSubset = require('is-subset');


// True;
isSubset(
  {a: 1, b: {c: 3, d: 4}, e: 5},
  {a: 1, b: {c: 3}}
);

//False;
isSubset(
  {a: 1},
  {a: 1, b: 2}
);

GIF FTW!

is-subset

Suggest a module

Comments