Skip to main content

Function: assertNoSymlinkLeaves()

assertNoSymlinkLeaves(dir, consumer, externalLinks?): Promise<void>

For a step that stores what a symlink points to instead of the symlink (a Windows archive or installer, an AppX/MSIX package, a NuGet package): refuses a symlink in dir that leads outside it, which would put files from elsewhere on the build machine into the artifact, unless the fileOptions.allowExternalLinks build option (externalLinks) allows it.

Parameters​

dir​

string

consumer​

string

what dereferences, for the error message, e.g. "the Windows zip archive"

ExternalLinkPolicy | null

Returns​

Promise<void>

Throws​

InvalidConfigurationError with code ERR_PATH_OUTSIDE_ROOT