deno.land / std@0.224.0 / path / normalize.ts

normalize.ts
View Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.// This module is browser compatible.
import { isWindows } from "./_os.ts";import { normalize as posixNormalize } from "./posix/normalize.ts";import { normalize as windowsNormalize } from "./windows/normalize.ts";/** * Normalize the `path`, resolving `'..'` and `'.'` segments. * Note that resolving these segments does not necessarily mean that all will be eliminated. * A `'..'` at the top-level will be preserved, and an empty path is canonically `'.'`. * @param path to be normalized */export function normalize(path: string): string { return isWindows ? windowsNormalize(path) : posixNormalize(path);}
std

Version Info

Tagged at
6 months ago