Traversal API

NameSummaryNotes & Examples
path

the path being validated or morphed

✅ array indices represented as numbers

⚠️ mutated during traversal - use path.slice(0) to snapshot

🔗 use

propString

for a stringified version

errorsArkErrors

that will be part of this traversal's finalized result

✅ will always be an empty array for a valid traversal

root

the original value being traversed

config

configuration for this traversal

✅ options can affect traversal results and error messages

✅ defaults < global config < scope config

✅ does not include options configured on individual types

reject

add an

ArkError

and return false

✅ useful for predicates like .narrow

mustBe

add an

ArkError

from a description and return false

✅ useful for predicates like .narrow

🔗 equivalent to

reject

({ expected })

error

add and return an

ArkError

✅ useful for morphs like .pipe

hasError

whether

currentBranch

(or the traversal root, outside a union) has one or more errors