New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-esm-resolver

Package Overview
Dependencies
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-esm-resolver - npm Package Compare versions

Comparing version 2.0.0 to 2.1.0

46

lib/index.js

@@ -14,2 +14,4 @@ "use strict";

var _process = _interopRequireDefault(require("process"));
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }

@@ -20,21 +22,24 @@

function moduleIsBuiltin(name) {
// Node v9.3.0+
const list = _module.default.builtinModules;
while (!moduleIsBuiltinCache) {
// Node v9.3.0+
const list = _module.default.builtinModules;
if (list) {
moduleIsBuiltinCache = moduleIsBuiltinCache || new Set(list);
return moduleIsBuiltinCache.has(name);
} // Older versions:
if (list) {
moduleIsBuiltinCache = new Set(list);
break;
} // Older versions:
if (_module.default._resolveFilename) {
try {
return _module.default._resolveFilename(name) === name;
} catch (err) {// Do nothing.
const natives = _process.default.binding('natives');
if (natives) {
const list = Object.keys(natives).filter(s => !/^internal\//.test(s));
moduleIsBuiltinCache = new Set(list);
break;
}
return false;
throw new Error('Cannot lookup builtin modules');
}
throw new Error('Cannot lookup builtin modules');
return moduleIsBuiltinCache.has(name);
}

@@ -60,2 +65,6 @@

function importIsBuiltin(path) {
return moduleIsBuiltin(path);
}
function importIsUrl(path) {

@@ -255,9 +264,2 @@ return /^[^/]+:\/\//.test(path);

return;
} // Ignore module if a builtin module.
const moduleName = bareImport.name;
if (moduleIsBuiltin(moduleName)) {
return;
} // Resolve the module base, or fail.

@@ -269,2 +271,3 @@

} = state.file.opts;
const moduleName = bareImport.name;
const moduleDir = resolveModuleDir(moduleName, filename); // Try different entry resolvers.

@@ -338,2 +341,7 @@

return;
} // Ignore any builin modules.
if (importIsBuiltin(src)) {
return;
} // Check if file path.

@@ -340,0 +348,0 @@

{
"name": "babel-plugin-esm-resolver",
"description": "A Babel plugin for resolving ESM import and export paths",
"version": "2.0.0",
"version": "2.1.0",
"keywords": [

@@ -6,0 +6,0 @@ "babel",

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc