loudo-ds-map-interfaces 0.0.14 → 0.0.16

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -9,6 +9,7 @@ export declare abstract class BaseMap<K extends {}, V extends {}> {
9
9
  abstract get valueEq(): (v1: V, v2: V) => boolean;
10
10
  get eq(): (e1: Entry<K, V>, e2: Entry<K, V>) => boolean;
11
11
  hasKey(key: K): boolean;
12
+ hasAllKeys(keys: Iterable<K>): boolean;
12
13
  get keys(): Sized<K>;
13
14
  get values(): Sized<V>;
14
15
  }
package/dist/index.js CHANGED
@@ -10,6 +10,12 @@ export class BaseMap {
10
10
  };
11
11
  }
12
12
  hasKey(key) { return this.get(key) !== undefined; }
13
+ hasAllKeys(keys) {
14
+ for (const k of keys)
15
+ if (!this.hasKey(k))
16
+ return false;
17
+ return true;
18
+ }
13
19
  get keys() { return this.map(x => x.key); }
14
20
  get values() { return this.map(x => x.value); }
15
21
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "loudo-ds-map-interfaces",
3
3
  "type": "module",
4
- "version": "0.0.14",
4
+ "version": "0.0.16",
5
5
  "description": "Core interfaces for loud maps (dictionaries.)",
6
6
  "main": "dist/index.js",
7
7
  "types": "dist/index.d.ts",