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 0.1.2 to 0.1.3

24

index.js

@@ -75,9 +75,3 @@ 'use strict';

assertFilenameRequired(filename);
var extension = '.js';
filenameNoExtCache = filename;
do {
filenameNoExtCache = path.basename(filenameNoExtCache, extension);
extension = path.extname(filenameNoExtCache);
} while (extension !== '');
filenameNoExtCache = removeExtensions(filename);
}

@@ -112,2 +106,16 @@ return filenameNoExtCache;

/**
* Removes all extensions from the given filename.
* @param {string} filename
* @return {string}
*/
function removeExtensions(filename) {
var extension = path.extname(filename);
while (extension !== '') {
filename = path.basename(filename, extension);
extension = path.extname(filename);
}
return filename;
}
return new babel.Transformer('globals', {

@@ -144,3 +152,3 @@ /**

self.state.opts,
node.source.value,
removeExtensions(node.source.value),
specifier.imported ? specifier.imported.name : null,

@@ -147,0 +155,0 @@ t.isImportNamespaceSpecifier(specifier)

{
"name": "babel-plugin-globals",
"version": "0.1.2",
"version": "0.1.3",
"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