Skip to content

assertPathWithinAsync

assertPathWithinAsync(root, path, options?): Promise<string>

Defined in: packages/node/src/fs/path-within.ts:279

Require that path stays inside root once both are resolved through symbolic links, and hand back the real path.

Same semantics and the same TOCTOU caveat as isPathWithinAsync; use the returned path rather than the argument, so the value opened is the value that was checked.

string

The directory the path must stay inside.

string

The path to check.

PathWithinOptions

Resolution base, root-equality and case-folding policy.

Promise<string>

A promise for the real absolute path.

PathEscapeError If the real path is outside the real root.