Skip to content

Function: fromFileUrl()

ts
function fromFileUrl(url): string;

将 file:// URL 转换为路径。

Parameters

ParameterTypeDescription
urlstring要转换的 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

Released under the MIT License.