Function: fromFileUrl()
ts
function fromFileUrl(url): string;将 file:// URL 转换为路径。
Parameters
| Parameter | Type | Description |
|---|---|---|
url | string | 要转换的 file:// URL |
Returns
string
路径字符串
Example
ts
fromFileUrl('file:///foo/bar') // => '/foo/bar'
fromFileUrl('file:///C:/temp/foo.txt') // => 'C:/temp/foo.txt'
fromFileUrl('file://host/share/file.txt') // => '//host/share/file.txt'Since
1.0.0