Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-plugin-add-module-require

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-add-module-require - npm Package Compare versions

Comparing version 1.0.2 to 1.0.3

6

index.js

@@ -7,3 +7,3 @@ module.exports = function (babel) {

CallExpression(path) {
if (path.BABEL_PLUGIN_ADD_MODULE_REQUIRE || path.node.BABEL_PLUGIN_ADD_MODULE_REQUIRE || path.node.callee.name !== 'require' || !/^[\.\/]/.test(path.node.arguments[0].value)) {
if (path.BABEL_PLUGIN_ADD_MODULE_REQUIRE || path.node.BABEL_PLUGIN_ADD_MODULE_REQUIRE || path.node.callee.name !== 'require' || /^\w/.test(path.node.arguments[0].value)) {
return;

@@ -65,3 +65,3 @@ }

ImportDeclaration(path) {
if (path.BABEL_PLUGIN_ADD_MODULE_REQUIRE || !/^[\.\/]/.test(path.node.source.value)) {
if (path.BABEL_PLUGIN_ADD_MODULE_REQUIRE || /^\w/.test(path.node.source.value)) {
return;

@@ -89,3 +89,3 @@ }

'in',
item.imported,
t.stringLiteral(item.imported.name),
requireExpression

@@ -92,0 +92,0 @@ ),

{
"name": "babel-plugin-add-module-require",
"version": "1.0.2",
"version": "1.0.3",
"description": "A plugin like babel-plugin-add-module-exports and supports babel@7.",

@@ -5,0 +5,0 @@ "main": "index.js",

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