mirror of
https://github.com/denoland/std.git
synced 2024-11-22 04:59:05 +00:00
d102a10235
* refactor: import from `@std/assert` * update
22 lines
596 B
TypeScript
22 lines
596 B
TypeScript
// Copyright 2018-2024 the Deno authors. All rights reserved. MIT license.
|
|
// This module is browser compatible.
|
|
|
|
/**
|
|
* Converts a path to a namespaced path. This function returns the path as is on posix.
|
|
*
|
|
* @example Usage
|
|
* ```ts
|
|
* import { toNamespacedPath } from "@std/path/posix/to-namespaced-path";
|
|
* import { assertEquals } from "@std/assert";
|
|
*
|
|
* assertEquals(toNamespacedPath("/home/foo"), "/home/foo");
|
|
* ```
|
|
*
|
|
* @param path The path.
|
|
* @returns The namespaced path.
|
|
*/
|
|
export function toNamespacedPath(path: string): string {
|
|
// Non-op on posix systems
|
|
return path;
|
|
}
|