schema-components - v3.7.0
    Preparing search index...

    Function setNestedValue

    • Set a value at a dot-separated path, producing a new root object. Does not mutate the input — returns a shallow-updated copy at each level.

      Refuses paths whose segments name a prototype-polluting property (__proto__, constructor, prototype). Such a path could otherwise mutate Object.prototype (or similar) through the assignment, planting fields visible to every plain object in the runtime. The input root is returned unchanged so the caller's onChange handler treats the write as a no-op rather than propagating a poisoned state. This matches the silent-refusal semantics of dereference in core/ref.ts when a JSON Pointer segment names a prototype-polluting key.

      Parameters

      • root: unknown
      • path: string
      • leafValue: unknown

      Returns unknown