/** * This Source Code is subject to the terms of the Mozilla Public * License, v. 2.0. If a copy of the MPL was not distributed with this * file, You can obtain one at http://mozilla.org/MPL/2.0/. * * Copyright (c) Infonomic Company Limited * * Minimal nested `get`/`set` over string field paths, replacing lodash-es * (which pulled a large shared chunk onto unrelated bundles). Supports the * dot + bracket notation produced by the form field-path builders, e.g. * `title`, `a.b.c`, `items[0].title`, `blocks[id=abc].nested[1].field`. * * `set` mirrors lodash semantics: it creates intermediate **arrays** when the * next path segment is a numeric index and plain **objects** otherwise, and it * mutates `object` in place (callers shallow-copy the root first, as before). * * Deliberately NOT a general lodash replacement — it does not handle quoted * keys (`a["b.c"]`), negative indices, or array-path inputs, none of which the * form paths ever produce. See nested-path.test.node.ts for the covered cases. */ /** Split a field path into segments: `items[0].title` -> ['items','0','title']. */ export declare function toPath(path: string): string[]; export declare function get(object: unknown, path: string): T; /** Whether every stable-id selector in a path still identifies a live item. */ export declare function hasExistingIdTargets(object: unknown, path: string): boolean; /** Set a path and report whether all stable-id selectors resolved. */ export declare function setWithResult(object: T, path: string, value: unknown): boolean; export declare function set(object: T, path: string, value: unknown): T; /** Clone only the containers along a write path, preserving other snapshots. */ export declare function withValue(object: T, path: string, value: unknown): T | undefined;