Skip to content

isAbsolute

The isAbsolute() function checks whether a path is absolute and does not traverse above root.

WARNING

Works only with POSIX paths (not Windows paths).

Interactive example

Syntax

typescript
function isAbsolute(
	path: string
): boolean;

Parameters

  • path : The path to test.

Return value

A boolean indicating whether the path is absolute.

See also

  • resolveFrom - Resolves a list of segments from an origin

Released under the MIT license.