0.1.2 • Published 6 years ago
map-containskeys v0.1.2
map-containskeys
NOTE: map-containskeys was renamed to @extra-map/contains-keys.
Check if map contains all keys.
const containsKeys = require('map-containskeys');
// containsKeys(<map>, <keys>, [begin=0], [end])
// -> true | false
var m = new Map([['H', 'Histidine'], ['I', 'Isoleucine'], ['L', 'Leucine']]);
containsKeys(m, new Set('IL'));
// true (m con I,L)
containsKeys(m, ['G', 'I', 'J']);
// false (m !con G,I,J)
containsKeys(m, ['G', 'I', 'J'], 1);
// false (m !con I,J)
containsKeys(m, ['G', 'I', 'J'], 1, 2);
// true (m con I)