This commit is contained in:
Lilith 2025-02-27 02:26:55 +01:00
parent a71a3b5593
commit cb52890889
Signed by: lilith
GPG key ID: 8712A0F317C37175
16657 changed files with 1483086 additions and 1 deletions

22
home/ags/node_modules/is-builtin-module/index.js generated vendored Normal file
View file

@ -0,0 +1,22 @@
'use strict';
const builtinModules = require('builtin-modules');
const moduleSet = new Set(builtinModules);
const NODE_PROTOCOL = 'node:';
module.exports = moduleName => {
if (typeof moduleName !== 'string') {
throw new TypeError('Expected a string');
}
if (moduleName.startsWith(NODE_PROTOCOL)) {
moduleName = moduleName.slice(NODE_PROTOCOL.length);
}
const slashIndex = moduleName.indexOf('/');
if (slashIndex !== -1 && slashIndex !== moduleName.length - 1) {
moduleName = moduleName.slice(0, slashIndex);
}
return moduleSet.has(moduleName);
};