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

babel-plugin-globals

Package Overview
Dependencies
Maintainers
1
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-plugin-globals - npm Package Compare versions

Comparing version 1.1.0 to 1.1.1

11

index.js

@@ -40,2 +40,5 @@ 'use strict';

createGlobal(id.name, nodes);
if (!t.isExpression(expression)) {
expression = t.toExpression(expression);
}
nodes.push(t.expressionStatement(t.assignmentExpression('=', id, expression)));

@@ -189,3 +192,9 @@ }

var id = getGlobalIdentifier(state, getFilenameNoExt(state.file.opts.filename));
assignToGlobal(id, replacements, nodePath.node.declaration);
var expression = nodePath.node.declaration;
if (expression.id &&
(t.isFunctionDeclaration(expression) || t.isClassDeclaration(expression))) {
replacements.push(expression);
expression = expression.id;
}
assignToGlobal(id, replacements, expression);
nodePath.replaceWithMultiple(replacements);

@@ -192,0 +201,0 @@ },

2

package.json
{
"name": "babel-plugin-globals",
"version": "1.1.0",
"version": "1.1.1",
"description": "A babel plugin that exposes ES6 modules to global variables.",

@@ -5,0 +5,0 @@ "license": "MIT",

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