MCPcopy Create free account
hub / github.com/nodejs/node / normalizeOrigin

Function normalizeOrigin

deps/undici/src/lib/mock/mock-utils.js:453–463  ·  view source on GitHub ↗
(origin)

Source from the content-addressed store, hash-verified

451}
452
453function normalizeOrigin (origin) {
454 if (typeof origin !== 'string' && !(origin instanceof URL)) {
455 return origin
456 }
457
458 if (origin instanceof URL) {
459 return origin.origin
460 }
461
462 return origin.toLowerCase()
463}
464
465function buildAndValidateMockOptions (opts) {
466 const { agent, ...mockOptions } = opts

Callers 2

getMethod · 0.85
dispatchMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected