fix module specifier default output
This commit is contained in:
parent
d473826a68
commit
876d88c761
@ -4,8 +4,8 @@ var t = require("../../types");
|
|||||||
var _ = require("lodash");
|
var _ = require("lodash");
|
||||||
|
|
||||||
exports.ImportSpecifier = function (node, print) {
|
exports.ImportSpecifier = function (node, print) {
|
||||||
if (node.id && node.id.name === "default") {
|
if (t.isSpecifierDefault(node)) {
|
||||||
print(node.name);
|
print(t.getSpecifierName(node));
|
||||||
} else {
|
} else {
|
||||||
return exports.ExportSpecifier.apply(this, arguments);
|
return exports.ExportSpecifier.apply(this, arguments);
|
||||||
}
|
}
|
||||||
@ -71,7 +71,7 @@ exports.ImportDeclaration = function (node, print) {
|
|||||||
self.push(", ");
|
self.push(", ");
|
||||||
}
|
}
|
||||||
|
|
||||||
var isDefault = spec.id && spec.id.name === "default";
|
var isDefault = t.isSpecifierDefault(spec);
|
||||||
|
|
||||||
if (!isDefault && spec.type !== "ImportBatchSpecifier" && !foundImportSpecifier) {
|
if (!isDefault && spec.type !== "ImportBatchSpecifier" && !foundImportSpecifier) {
|
||||||
foundImportSpecifier = true;
|
foundImportSpecifier = true;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user