Socket
Socket
Sign inDemoInstall

es6-module-transpiler-amd-formatter

Package Overview
Dependencies
Maintainers
2
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

es6-module-transpiler-amd-formatter - npm Package Compare versions

Comparing version 0.2.2 to 0.2.3

46

index.js

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

function sourcePosition(mod, node) {
var loc = node && node.loc;
if (loc) {
return mod.relativePath + ':' + loc.start.line + ':' + (loc.start.column + 1);
} else {
return mod.relativePath;
}
}
/**

@@ -332,14 +323,29 @@ * The 'YUI.add' setting for referencing exports aims to produce code that can

mod.imports.names.forEach(function (name) {
var importDeclaration = mod.imports.findSpecifierByName(name),
id = mod.getModule(importDeclaration.declaration.node.source.value).id;
var specifier = mod.imports.findSpecifierByName(name),
id = mod.getModule(specifier.declaration.node.source.value).id;
prelude.push(b.variableDeclaration('var', [b.identifier(importDeclaration.name)]));
prelude.push(b.expressionStatement(b.assignmentExpression("=",
b.identifier(importDeclaration.name),
b.memberExpression(
b.identifier(id),
b.literal(importDeclaration.from),
true
)
)));
if (!specifier) {
return null;
}
prelude.push(b.variableDeclaration('var', [b.identifier(specifier.name)]));
if (specifier.from) {
// import { value } from './a';
// import a from './a';
prelude.push(b.expressionStatement(b.assignmentExpression("=",
b.identifier(specifier.name),
b.memberExpression(
b.identifier(id),
b.literal(specifier.from),
true
)
)));
} else {
// import * as a from './a'
prelude.push(b.expressionStatement(b.assignmentExpression("=",
b.identifier(specifier.name),
b.identifier(id)
)));
}
});

@@ -346,0 +352,0 @@

{
"name": "es6-module-transpiler-amd-formatter",
"version": "0.2.2",
"version": "0.2.3",
"description": "ES6 Module Transpiler Extension to Output AMD define() Format.",

@@ -30,3 +30,3 @@ "author": "Caridy Patino <caridy@gmail.com>",

"requirejs": "^2.1.14",
"es6-module-transpiler": "~0.8.2",
"es6-module-transpiler": "~0.9.0",
"chai": "~1.8.1",

@@ -33,0 +33,0 @@ "mocha": "~1.15.1",

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