deep-trails - v3.0.0-beta.3
    Preparing search index...

    Type Alias ChildContext<P, K, V>

    Describes the context of a child node during deep iteration.

    Provides metadata about the node's position and relationship within its parent.

    3.0.0-beta.0

    type ChildContext<P extends object, K = unknown, V = unknown> = {
        depth: number;
        index: number;
        key: K;
        parentValue: P;
        path: string | Readonly<K[]>;
        value: V;
    }

    Type Parameters

    • P extends object
    • K = unknown
    • V = unknown
    Index

    Properties

    depth: number

    The depth of this node in the structure, starting from the root at level 0.

    index: number

    The zero-based index of this child within its parent.

    Indicates the discovery order, even for disordered structures.

    key: K

    The key or identifier of this node within its parent.

    parentValue: P

    A reference to the parent object of this child node.

    Mutating it will affect the source structure.

    path: string | Readonly<K[]>

    The path from the root node to this child.

    Its type varies depending on the value of "pathType" in the options.

    value: V

    The value of this child node.

    • For objects and symbols, it is a reference.
    • For other primitives, it is a copy.
    • If it is an object, mutating it will affect the source structure.