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

Function handleInvalidType

lib/internal/modules/esm/assert.js:99–110  ·  view source on GitHub ↗

* Throw the correct error depending on what's wrong with the type attribute. * @param {string} url The resolved URL for the module to be imported * @param {string} type The value of the import attributes' `type` property

(url, type)

Source from the content-addressed store, hash-verified

97 * @param {string} type The value of the import attributes' `type` property
98 */
99function handleInvalidType(url, type) {
100 // `type` might have not been a string.
101 validateString(type, 'type');
102
103 // `type` might not have been one of the types we understand.
104 if (!ArrayPrototypeIncludes(supportedTypeAttributes, type)) {
105 throw new ERR_IMPORT_ATTRIBUTE_UNSUPPORTED('type', type, url);
106 }
107
108 // `type` was the wrong value for this format.
109 throw new ERR_IMPORT_ATTRIBUTE_TYPE_INCOMPATIBLE(url, type);
110}
111
112
113module.exports = {

Callers 1

validateAttributesFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…