MCPcopy Index your code
hub / github.com/nodejs/node / throwIfInvalidParentURL

Function throwIfInvalidParentURL

lib/internal/modules/esm/resolve.js:943–950  ·  view source on GitHub ↗

* Validate user-input in `context` supplied by a custom loader. * @param {string | URL | undefined} parentURL - The parent URL. * @returns {void}

(parentURL)

Source from the content-addressed store, hash-verified

941 * @returns {void}
942 */
943function throwIfInvalidParentURL(parentURL) {
944 if (parentURL === undefined) {
945 return; // Main entry point, so no parent
946 }
947 if (typeof parentURL !== 'string' && !isURL(parentURL)) {
948 throw new ERR_INVALID_ARG_TYPE('parentURL', ['string', 'URL'], parentURL);
949 }
950}
951
952/**
953 * Resolves the given specifier using the provided context, which includes the parent URL and conditions.

Callers 2

resolveMethod · 0.85
defaultResolveFunction · 0.85

Calls 1

isURLFunction · 0.50

Tested by

no test coverage detected