MCPcopy Create free account
hub / github.com/CommE2E/comm / assignValueWithKey

Function assignValueWithKey

lib/utils/objects.js:51–60  ·  view source on GitHub ↗
(
  obj: NestedObjectMap<K, T>,
  key: K,
  value: T | NestedObjectMap<K, T>,
)

Source from the content-addressed store, hash-verified

49}
50
51function assignValueWithKey<K, T>(
52 obj: NestedObjectMap<K, T>,
53 key: K,
54 value: T | NestedObjectMap<K, T>,
55): NestedObjectMap<K, T> {
56 return {
57 ...obj,
58 ...Object.fromEntries([[key, value]]),
59 };
60}
61
62function hash(obj: ?Object): number {
63 if (!obj) {

Callers 1

deepDiffFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected