2.2.5 • Published 3 years ago

@extra-object/subsets v2.2.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

Lists all possible subsets. :running: :package: :ledger:

Similar: subobject, subobjects, isSubobject. This is part of package extra-object.

object.subsets(x, [n]);
// x: an object
// n: number of entries (-1 => any)
const object = require('extra-object');

var x = {a: 1, b: 2};
[...object.subsets(x)];
// [ {}, { a: 1 }, { b: 2 }, { a: 1, b: 2 } ]

var x = {a: 1, b: 2, c: 3};
[...object.subsets(x)];
// [
//   {},
//   { a: 1 },
//   { b: 2 },
//   { a: 1, b: 2 },
//   { c: 3 },
//   { a: 1, c: 3 },
//   { b: 2, c: 3 },
//   { a: 1, b: 2, c: 3 }
// ]

references

2.2.5

3 years ago

2.2.4

4 years ago

2.2.3

4 years ago

2.2.1

4 years ago

2.2.0

4 years ago

2.2.2

4 years ago

2.1.23

4 years ago

2.1.21

4 years ago

2.1.22

4 years ago

2.1.20

4 years ago