Class: ExternalLinkPolicy
The resolved fileOptions.allowExternalLinks build option: which symlinks may lead outside the app, the workspace and the package-manager store,
by the real path of what they point to. It only relaxes what is packaged (a file reached through a link, a copied link, a link in a
Windows archive or installer); a write through a symlink is refused regardless (see WriteContainment).
Properties
allowAll
readonlyallowAll:boolean
fileOptions.allowExternalLinks: true
projectDir
readonlyprojectDir:string|null
the project directory, as configured, to show paths relative to it
realRoots
readonlyrealRoots: readonlystring[]
the real paths of the listed entries
NONE
readonlystaticNONE:ExternalLinkPolicy
Allows nothing, for callers that have no build configuration.
Methods
allows()
allows(
link,resolved):boolean
Whether the option allows the link link (or a file reached through it), whose real target is resolved. When it does, a warning is
logged once per process, so that an allowed link does not go unnoticed.
Parameters
link
string
resolved
string
Returns
boolean
displayPath()
displayPath(
file):string
file relative to the project directory when it is inside it, otherwise as it is.
Parameters
file
string
Returns
string
hint()
hint(
resolved):Promise<string>
The sentence that tells how to allow links leading to resolved (real paths): the directory of each (itself when it is one),
relative to the project directory when it is inside it, otherwise absolute.
Parameters
resolved
readonly string[]
Returns
Promise<string>
create()
staticcreate(value,projectDir,optionPath?):Promise<ExternalLinkPolicy>
Resolves the option: an entry is a path relative to projectDir, or absolute, and is compared by its real path.
optionPath is where the value was set (e.g. mac.fileOptions.allowExternalLinks), for the errors below.
Parameters
value
projectDir
string
optionPath?
string = ALLOW_EXTERNAL_LINKS_OPTION
Returns
Promise<ExternalLinkPolicy>
Throws
InvalidConfigurationError when the value is not a boolean or a list of paths, or when a listed path does not exist