Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/ayonli_jsext/path/util.ts>isAbsolute

A JavaScript extension package for building strong and modern applications.
Latest
function isAbsolute
import { isAbsolute } from "https://deno.land/x/ayonli_jsext@v0.9.72/path/util.ts";

Checks if the given path is an absolute path.

Examples

Example 1

import { isAbsolute } from "@ayonli/jsext/path";

console.assert(isAbsolute("/usr/bin"));
console.assert(isAbsolute("C:\\Windows\\System32"));
console.assert(isAbsolute("http://example.com"));
console.assert(isAbsolute("file:///C:/Windows/System32"));
console.assert(isAbsolute("file://localhost/C:/Windows/System32?foo=bar#baz"));

Parameters

path: string

Returns

boolean