UNPKG

@jsenv/util

Version:

Set of functions often needed when using Node.js.

8 lines (6 loc) 211 B
export const resolveUrl = (specifier, baseUrl) => { if (typeof baseUrl === "undefined") { throw new TypeError(`baseUrl missing to resolve ${specifier}`) } return String(new URL(specifier, baseUrl)) }