Shares many similar methods with TreeContext, refer to that class for documentation.

Implements

Constructors

Properties

_context: any[] | Record<string, any>
_rootContext: any[] | Record<string, any>
breakEmitter: (() => void)

Type declaration

    • (): void
    • Returns void

depth: number
path: readonly (string | number)[]

Accessors

Methods

  • Merges the provided context with the current context.

    Parameters

    • newContext: ObjectOrArray

      The new context to merge.

    • removeExisting: boolean = false

      Optional. Specifies whether to remove existing values in the current context. Default is false.

    Returns "CONTEXT_MERGED" | "NOT_CONTEXT_OR_ARRAY"

    The status of the context merge operation.

  • Replaces the value at the current path with the specified value. If the current context is already at the root or an empty path, it returns treeUpdateStatus.ALREADY_AT_ROOT_OR_EMPTY_PATH. If the parent is an array and the last path element is not a valid index, it returns treeUpdateStatus.INVALID_INDEX_TYPE_FOR_ARRAY. Otherwise, it replaces the value at the current path and returns treeUpdateStatus.CONTEXT_REPLACED.

    Parameters

    • value: null | {}

      The value to replace with.

    Returns "CONTEXT_REPLACED" | "ALREADY_AT_ROOT_OR_EMPTY_PATH" | "INVALID_INDEX_TYPE_FOR_ARRAY"

    The status of the tree update operation.

Generated using TypeDoc