MCPcopy Create free account
hub / github.com/nodejs/undici / parseOrigin

Function parseOrigin

lib/core/util.js:239–247  ·  view source on GitHub ↗

* @param {string|URL|Record } url * @returns {URL}

(url)

Source from the content-addressed store, hash-verified

237 * @returns {URL}
238 */
239function parseOrigin (url) {
240 url = parseURL(url)
241
242 if (url.pathname !== '/' || url.search || url.hash) {
243 throw new InvalidArgumentError('invalid url')
244 }
245
246 return url
247}
248
249/**
250 * @param {string} host

Callers

nothing calls this directly

Calls 1

parseURLFunction · 0.85

Tested by

no test coverage detected