UNPKG

z-utils-ts

Version:

使用TypeScript编写的工具函数库

10 lines 232 B
export function parseUrl(url: string) { const urlObj = new URL(url); return { protocol: urlObj.protocol, host: urlObj.host, pathname: urlObj.pathname, search: urlObj.search, hash: urlObj.hash, }; }