UNPKG

@flex-development/pathe

Version:

Universal drop-in replacement for node:path

32 lines (31 loc) 1.06 kB
/** * @file toNamespacedPath * @module pathe/lib/toNamespacedPath */ import type { ResolveWithOptions } from '@flex-development/pathe'; /** * Get an equivalent [namespace-prefixed path][namespace] for `path`. * * > 👉 **Note**: If `path` is not a [drive][drive] or [UNC][unc] path, it will * > be returned without modifications. * * [drive]: https://learn.microsoft.com/windows/win32/fileio/naming-a-file#naming-conventions * [namespace]: https://docs.microsoft.com/windows/desktop/FileIO/naming-a-file#namespaces * [unc]: https://learn.microsoft.com/dotnet/standard/io/file-path-formats#unc-paths * * @see {@linkcode ResolveWithOptions} * * @category * core * * @this {void} * * @param {string} path * The path to handle * @param {ResolveWithOptions | null | undefined} [options] * Resolution options * @return {string} * Namespace-prefixed path or `path` without modifications */ declare function toNamespacedPath(this: void, path: string, options?: ResolveWithOptions | null | undefined): string; export default toNamespacedPath;