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

es6-module-transpiler

Package Overview
Dependencies
Maintainers
3
Versions
31
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es6-module-transpiler - npm Package Compare versions

Comparing version 0.9.2 to 0.9.3

13

lib/formatters/commonjs_formatter.js

@@ -481,3 +481,3 @@ /* jshint node:true, undef:true, unused:true */

/**
* Process a variable declaration found at the top level of the module. Since
* Process a function declaration found at the top level of the module. Since
* we do not need to rewrite exported functions, we can leave function

@@ -493,2 +493,13 @@ * declarations alone.

/**
* Process a class declaration found at the top level of the module. Since
* we do not need to rewrite exported classes, we can leave class
* declarations alone.
*
* @override
*/
CommonJSFormatter.prototype.processClassDeclaration = function(mod, nodePath) {
return null;
};
/**
* Since import declarations only control how we rewrite references we can just

@@ -495,0 +506,0 @@ * remove them -- they don't turn into any actual statements.

@@ -116,3 +116,3 @@ /* jshint node:true, undef:true, unused:true */

/**
* Process a variable declaration found at the top level of the module.
* Process a function declaration found at the top level of the module.
*

@@ -128,2 +128,13 @@ * @param {Module} mod

/**
* Process a class declaration found at the top level of the module.
*
* @param {Module} mod
* @param {NodePath} nodePath
* @return {?Node[]}
*/
Formatter.prototype.processClassDeclaration = function(mod, nodePath) {
throw new Error('#processClassDeclaration must be implemented in subclasses');
};
/**
* Process a variable declaration found at the top level of the module.

@@ -130,0 +141,0 @@ *

@@ -171,2 +171,19 @@ /* jshint node:true, undef:true, unused:true */

/**
* Process all top-level class declarations in case they need to be processed.
*
* @param {NodePath} nodePath
* @private
*/
Rewriter.prototype.visitClassDeclaration = function(nodePath) {
if (n.Program.check(nodePath.parent.node)) {
var replacement = this.formatter.processClassDeclaration(this.currentModule, nodePath);
if (replacement) {
this.replacements.push(replacement);
}
}
this.traverse(nodePath);
};
/**
* Look for all export declarations so we can rewrite them.

@@ -173,0 +190,0 @@ *

4

package.json
{
"name": "es6-module-transpiler",
"version": "0.9.2",
"version": "0.9.3",
"description": "es6-module-transpiler is an experimental compiler that allows you to write your JavaScript using a subset of the current ES6 module syntax, and compile it into various formats.",

@@ -59,2 +59,2 @@ "homepage": "http://esnext.github.io/es6-module-transpiler",

}
}
}
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