@blockchaincommons/dcbor - v1.0.0-beta.1
    Preparing search index...

    Function walk

    Walk a CBOR tree, visiting each element with a visitor function.

    The visitor function is called for each element in the tree, in depth-first order. State semantics:

    • The visitor's returned newState propagates down to descendants of the just-visited node only.
    • Sibling subtrees each receive an independent clone of the parent's post-visit state, so accumulating mutations in one subtree never leak into a sibling.
    • State changes do not propagate up: the public walk returns void.

    For maps, the visitor is called with:

    1. A 'keyvalue' element containing both key and value
    2. The key individually (if descent wasn't stopped)
    3. The value individually (if descent wasn't stopped)

    The type of state to pass into each visit

    The CBOR value to traverse

    Initial state value

    Function to call for each element The state-cloning visitor semantics (structuredClone per subtree) are still subject to refinement.