Skip to content

WalkTuple type

pathlib-ts > WalkTuple

Tuple returned by Path.walk() mirroring CPython’s (dirpath, dirnames, filenames) shape.

Signature:

export type WalkTuple = [Path, string[], string[]];

References: Path

The first element is the directory being visited, followed by shallow copies of the names reported in that directory. Mutating the dirnames array during a top-down walk prevents traversal into the removed entries, aligning with CPython’s documented behaviour.