Skip to content

containsResolvedPath

function containsResolvedPath(
fs,
root,
target): Promise<boolean>;

Containment against the filesystem-resolved paths, with symlinks followed.

A failure to resolve counts as “not contained”, so a missing path and an escaping symlink give the same answer and no caller has to tell them apart to stay safe. That is also why this must not be used on a path the caller intends to create later.

Parameter Type

fs

{ realpath: Promise<string>; }

fs.realpath

root

string

target

string

Promise<boolean>