Function isAbsolute
- is
Absolute (path): boolean Parameters
- path: string
Path to be verified as absolute.
Returns boolean
trueif path is absolute,falseotherwiseExample: Usage
import { isAbsolute } from "@std/path/is-absolute";
import { assert, assertFalse } from "@std/assert";
if (Deno.build.os === "windows") {
assert(isAbsolute("C:\\home\\foo"));
assertFalse(isAbsolute("home\\foo"));
} else {
assert(isAbsolute("/home/foo"));
assertFalse(isAbsolute("home/foo"));
}- path: string
Verifies whether provided path is absolute.