Comparing version 0.3.1 to 0.3.3
@@ -94,8 +94,9 @@ var acorn = require('acorn'); | ||
node.specifiers.forEach( function ( specifier ) { | ||
var declaration, name = specifier.id.name; | ||
var declaration, id = specifier.id.name, name; | ||
declaration = 'var ' + name + ' = ' + _import.name; | ||
if ( !options.defaultOnly ) { | ||
declaration += '.' + ( node.kind === 'default' ? 'default' : name ); | ||
if ( options.defaultOnlt ) { | ||
declaration = 'var ' + name + ' = ' + _import.name; | ||
} else { | ||
name = ( specifier.name && specifier.name.name ) || id; | ||
declaration = 'var ' + name + ' = ' + _import.name + '.' + ( node.kind === 'default' ? 'default' : id ); | ||
} | ||
@@ -102,0 +103,0 @@ |
{ | ||
"name": "esperanto", | ||
"description": "An easier way to convert ES6 modules to AMD and CommonJS", | ||
"version": "0.3.1", | ||
"version": "0.3.3", | ||
"author": "Rich Harris", | ||
@@ -6,0 +6,0 @@ "dependencies": { |
15533
256