MCPcopy Create free account
hub / github.com/CedarCopilot/cedar-OS / addToObject

Function addToObject

packages/cedar-os/src/utils/diffUtils.ts:18–27  ·  view source on GitHub ↗
(
	obj: T | null | undefined,
	key: K,
	value: V
)

Source from the content-addressed store, hash-verified

16 * @returns A new object with the key/value merged.
17 */
18export function addToObject<T extends Record<string, any>, K extends string, V>(
19 obj: T | null | undefined,
20 key: K,
21 value: V
22): T & Record<K, V> {
23 return {
24 ...(obj || {}),
25 [key]: value,
26 } as T & Record<K, V>;
27}

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected