MCPcopy Index your code
hub / github.com/tinyplex/tinybase / mapEquals

Function mapEquals

src/common/map.ts:47–58  ·  view source on GitHub ↗
(
  map1: Map<Key, Value>,
  map2: Map<Key, Value>,
)

Source from the content-addressed store, hash-verified

45 isUndefined(value) ? (collDel(map, key), map) : map?.set(key, value);
46
47export const mapEquals = <Key, Value>(
48 map1: Map<Key, Value>,
49 map2: Map<Key, Value>,
50): boolean =>
51 collSize(map1) === collSize(map2) &&
52 arrayEvery(mapKeys(map1), (key) => {
53 const value1 = mapGet(map1, key);
54 const value2 = mapGet(map2, key);
55 return isMap(value1) && isMap(value2)
56 ? mapEquals(value1, value2)
57 : value1 === value2;
58 });
59
60export const mapEnsure = <Key, Value>(
61 map: Map<Key, Value>,

Callers

nothing calls this directly

Calls 5

collSizeFunction · 0.90
arrayEveryFunction · 0.90
isMapFunction · 0.85
mapKeysFunction · 0.70
mapGetFunction · 0.70

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…