Skip to content

PersistentAI API Documentation / @persistentai/fireflow-types / setNestedValue

Function: setNestedValue()

setNestedValue(obj, path, value): void

Defined in: packages/fireflow-types/src/flow/execution/runtime/stream-bridge.ts:392

Set a value at a nested dot-separated path in an object. Creates intermediate objects as needed.

Parameters

obj

Record<string, unknown>

path

string

value

unknown

Returns

void

Example

typescript
const obj = {}
setNestedValue(obj, 'a.b.c', 42)
// obj is now { a: { b: { c: 42 } } }

Licensed under BUSL-1.1