Skip to content

Function: resolve()

ts
function resolve(...paths): string;

将路径或路径片段序列解析为绝对路径。

Parameters

ParameterTypeDescription
...pathsstring[]要解析的路径片段

Returns

string

解析后的绝对路径

Example

ts
resolve('/foo/bar', './baz') // => '/foo/bar/baz'
resolve('/foo/bar', '../baz') // => '/foo/baz'

Since

1.0.0

Released under the MIT License.