@dxos/echo
    Preparing search index...

    Function apply

    • Apply a sequence of find/replace Edits to the string value at path, returning the resulting full string. Implemented on top of splice so it works for both backends.

      An edit with a missing or empty oldString appends its newString. A non-replaceAll edit whose oldString is not found throws Error.TextEditNotFoundError.

      Must be called inside Obj.update(obj, () => { ... }).

      Parameters

      Returns string

      O(N) per edit plus O(M · N) for replaceAll (N = text length, M = matches): it re-reads and searches the whole string after every splice, so one replaceAll edit can be O(N²).