mirror of
https://github.com/denoland/std.git
synced 2024-11-21 20:50:22 +00:00
c46143f0ac
* chore: update copyright year * fix --------- Co-authored-by: Asher Gomez <ashersaupingomez@gmail.com>
16 lines
571 B
TypeScript
16 lines
571 B
TypeScript
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
// This module is browser compatible.
|
|
|
|
import { isWindows } from "./_os.ts";
|
|
import { format as posixFormat } from "./posix/format.ts";
|
|
import { format as windowsFormat } from "./windows/format.ts";
|
|
import { FormatInputPathObject } from "./_interface.ts";
|
|
|
|
/**
|
|
* Generate a path from `FormatInputPathObject` object.
|
|
* @param pathObject with path
|
|
*/
|
|
export function format(pathObject: FormatInputPathObject): string {
|
|
return isWindows ? windowsFormat(pathObject) : posixFormat(pathObject);
|
|
}
|