Skip to content

Latest commit

 

History

History
75 lines (44 loc) · 1.21 KB

File metadata and controls

75 lines (44 loc) · 1.21 KB
hide_title true
custom_edit_url
pagination_prev
pagination_next

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

Path.isDownwardRelative() method

Returns true if the specified path is a relative path and does not use .. to walk upwards.

Signature:

static isDownwardRelative(inputPath: string): boolean;

Parameters

Parameter

Type

Description

inputPath

string

Returns:

boolean

Example

// 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');