| hide_title | true |
|---|---|
| custom_edit_url | |
| pagination_prev | |
| pagination_next |
Home > @rushstack/node-core-library > Path > isDownwardRelative
Returns true if the specified path is a relative path and does not use .. to walk upwards.
Signature:
static isDownwardRelative(inputPath: string): boolean;|
Parameter |
Type |
Description |
|---|---|---|
|
inputPath |
string |
Returns:
boolean
// These evaluate to true
isDownwardRelative('folder');
isDownwardRelative('file');
isDownwardRelative('folder/');
isDownwardRelative('./folder/');
isDownwardRelative('./folder/file');
// These evaluate to false
isDownwardRelative('../folder');
isDownwardRelative('folder/../file');
isDownwardRelative('/folder/file');