Rush StackShopBlogEvents
Skip to main content

Home > @rushstack/node-core-library > Path > isUnderOrEqual

Path.isUnderOrEqual() method

Returns true if "childPath" is equal to "parentFolderPath", or if it is inside that folder or one of its children. The "childPath" can refer to any type of file system object.

Signature:

static isUnderOrEqual(childPath: string, parentFolderPath: string): boolean;

Parameters

ParameterTypeDescription
childPathstring
parentFolderPathstring

Returns:

boolean

Remarks

The indicated file/folder objects are not required to actually exist on disk. For example, "parentFolderPath" is interpreted as a folder name even if it refers to a file. If the paths are relative, they will first be resolved using path.resolve().