MCPcopy
hub / github.com/tinyplex/tinybase / mapSet

Function mapSet

src/common/map.ts:40–45  ·  view source on GitHub ↗
(
  map: Map<Key, Value> | undefined,
  key: Key,
  value?: Value,
)

Source from the content-addressed store, hash-verified

38 arrayMap([...(coll?.entries() ?? [])], ([key, value]) => cb(value, key));
39
40export const mapSet = <Key, Value>(
41 map: Map<Key, Value> | undefined,
42 key: Key,
43 value?: Value,
44): Map<Key, Value> | undefined =>
45 isUndefined(value) ? (collDel(map, key), map) : map?.set(key, value);
46
47export const mapEquals = <Key, Value>(
48 map1: Map<Key, Value>,

Callers 15

delSourceStoreListenersFunction · 0.90
syncStoreListenersFunction · 0.90
addRoutedResultListenerFunction · 0.90
writeGroupRowFunction · 0.90
setQueryDefinitionImplFunction · 0.90
listenToTableFunction · 0.90
rootRowChangedFunction · 0.90
delListenerFunction · 0.90
clearCheckpointIdFunction · 0.90
addCheckpointImplFunction · 0.90
setCheckpointFunction · 0.90
_registerListenersFunction · 0.90

Calls 2

isUndefinedFunction · 0.90
collDelFunction · 0.90

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…