deno.land / std@0.224.0 / path / posix / is_absolute.ts

is_absolute.ts
View Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.// This module is browser compatible.
import { assertPath } from "../_common/assert_path.ts";import { isPosixPathSeparator } from "./_util.ts";
/** * Verifies whether provided path is absolute * @param path to be verified as absolute */export function isAbsolute(path: string): boolean { assertPath(path); return path.length > 0 && isPosixPathSeparator(path.charCodeAt(0));}
std

Version Info

Tagged at
6 months ago