@flex-development/pathe
Version:
Universal drop-in replacement for node:path
31 lines (30 loc) • 860 B
text/typescript
/**
* @file fileURLToPath
* @module pathe/lib/fileURLToPath
*/
import type { FileUrlToPathOptions } from '@flex-development/pathe';
/**
* Convert a `file:` URL to a path.
*
* @see {@linkcode ErrInvalidFileUrlHost}
* @see {@linkcode ErrInvalidFileUrlPath}
* @see {@linkcode ErrInvalidUrlScheme}
* @see {@linkcode FileUrlToPathOptions}
*
* @category
* utils
*
* @this {void}
*
* @param {URL | string} url
* The `file:` URL object or string to convert to a path
* @param {FileUrlToPathOptions | null | undefined} [options]
* Conversion options
* @return {string}
* `url` as path
* @throws {ErrInvalidFileUrlHost}
* @throws {ErrInvalidFileUrlPath}
* @throws {ErrInvalidUrlScheme}
*/
declare function fileURLToPath(this: void, url: URL | string, options?: FileUrlToPathOptions | null | undefined): string;
export default fileURLToPath;