toAbsoluteUrl 函数用于将相对 URL 转换为绝对 URL。
import { toAbsoluteUrl } from '@movk/core'
toAbsoluteUrl('/path', 'https://example.com')
// 'https://example.com/path'
toAbsoluteUrl('../other', 'https://example.com/api/users')
// 'https://example.com/api/other'
toAbsoluteUrl('https://other.com', 'https://example.com')
// 'https://other.com' (已是绝对URL,不变)
toAbsoluteUrl(relativeUrl, baseUrl)将相对 URL 转换为绝对 URL。
7c832 — refactor!: 重构模块架构,拆分 utils 为专业化模块