UNPKG

@lonu/stc

Version:

A tool for converting OpenApi/Swagger/Apifox into code.

18 lines 609 B
/** * Return the directory path of a `path`. * * @example Usage * ```ts * import { dirname } from "@std/path/windows/dirname"; * import { assertEquals } from "@std/assert"; * * assertEquals(dirname("C:\\foo\\bar\\baz.ext"), "C:\\foo\\bar"); * assertEquals(dirname(new URL("file:///C:/foo/bar/baz.ext")), "C:\\foo\\bar"); * ``` * * @param path The path to get the directory from. * @returns The directory path. * @throws {TypeError} If `path` is a `URL` instance whose protocol is not `file:`. */ export declare function dirname(path: string | URL): string; //# sourceMappingURL=dirname.d.ts.map