2.1.6 • Published 4 years ago

@extra-lists/is-subset v2.1.6

Weekly downloads
1
License
MIT
Repository
github
Last release
4 years ago

Checks if lists has a subset. :running: :package: :ledger:

Similar: subset, subsets, isSubset. This is part of package extra-lists.

lists.isSubset(x, y, [fc], [fm]);
// x:  lists
// y:  subset?
// fc: compare function (a, b)
// fm: map function (v, k, x)
const lists = require('extra-lists');

var x = [['a', 'b', 'c', 'd'], [1, 2, 3, 4]];
var y = [['b', 'd'], [2, 4]];
lists.isSubset(x, y);
// true

var y = [['b', 'd'], [-2, -4]];
lists.isSubset(x, y);
// false

lists.isSubset(x, y, (a, b) => Math.abs(a) - Math.abs(b));
// true

lists.isSubset(x, y, null, v => Math.abs(v));
// true

references

2.1.3

4 years ago

2.1.6

4 years ago

2.1.5

4 years ago

2.1.2

4 years ago