2.2.15 • Published 3 years ago

@extra-map/has-subset.min v2.2.15

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

Checks if map has a subset. :package: :smiley_cat: :running: :vhs: :moon: :scroll: :newspaper: :blue_book:

Alternatives: has, hasValue, hasEntry, hasSubset, hasPath. Similar: subset, subsets, hasSubset.

This is part of package extra-map.

This is browserified, minified version of @extra-map/has-subset. It is exported as global variable map_hasSubset. CDN: unpkg, jsDelivr.

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

var x = new Map([["a", 1], ["b", 2], ["c", 3], ["d", 4]]);
var y = new Map([["b", 2], ["d", 4]]);
map.hasSubset(x, y);
// true

var y = new Map([["b", -2], ["d", -4]]);
map.hasSubset(x, y);
// false

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

map.hasSubset(x, y, null, v => Math.abs(v));
// true

References

2.2.15

3 years ago

2.2.13

3 years ago

2.2.14

3 years ago

2.2.12

3 years ago

2.2.11

3 years ago

2.2.10

3 years ago

2.2.8

3 years ago

2.2.7

4 years ago

2.2.6

4 years ago

2.2.5

4 years ago

2.2.4

4 years ago

2.2.3

4 years ago

2.2.2

4 years ago

2.2.1

4 years ago