Skip to content

combineURLs

Functions

combineURLs()

combineURLs(baseURL, ...relativeURLs): string

组合 URL

Parameters

ParameterTypeDescription
baseURLstring基路径
...relativeURLsstring[]一个或多个相对路径

Returns

string

Example

ts
combineURLs('/website')
// => '/website'

combineURLs('/website/', '/api')
// => '/website/api'

combineURLs('/website/', '/api', 'v2')
// => '/website/api/v2'