15 lines
510 B
TypeScript
15 lines
510 B
TypeScript
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
// This module is browser compatible.
|
|
|
|
import { isWindows } from "./_os.ts";
|
|
import { join as posixJoin } from "./posix/join.ts";
|
|
import { join as windowsJoin } from "./windows/join.ts";
|
|
|
|
/**
|
|
* Join all given a sequence of `paths`,then normalizes the resulting path.
|
|
* @param paths to be joined and normalized
|
|
*/
|
|
export function join(...paths: string[]): string {
|
|
return isWindows ? windowsJoin(...paths) : posixJoin(...paths);
|
|
}
|