fix styling errors
This commit is contained in:
@@ -96,7 +96,7 @@ exports.Literal = function (node) {
|
||||
this.push(val);
|
||||
} else if (type === "number") {
|
||||
this.push(val + "");
|
||||
} else if (type === "boolean" ) {
|
||||
} else if (type === "boolean") {
|
||||
this.push(val ? "true" : "false");
|
||||
} else if (node.regex) {
|
||||
this.push("/" + node.regex.pattern + "/" + node.regex.flags);
|
||||
|
||||
@@ -73,7 +73,7 @@ var importsVisitor = {
|
||||
};
|
||||
|
||||
DefaultFormatter.prototype.getLocalImports = function () {
|
||||
this.file.scope.traverse(this.file.ast, importsVisitor, this);
|
||||
this.file.scope.traverse(this.file.ast, importsVisitor, this);
|
||||
};
|
||||
|
||||
var remapVisitor = {
|
||||
|
||||
@@ -13,7 +13,7 @@ function Destructuring(opts) {
|
||||
this.kind = opts.kind;
|
||||
}
|
||||
|
||||
Destructuring.prototype.buildVariableAssignment = function (id, init) {
|
||||
Destructuring.prototype.buildVariableAssignment = function (id, init) {
|
||||
var op = this.operator;
|
||||
if (t.isMemberExpression(id)) op = "=";
|
||||
|
||||
@@ -32,7 +32,7 @@ function Destructuring(opts) {
|
||||
return node;
|
||||
};
|
||||
|
||||
Destructuring.prototype.buildVariableDeclaration = function (id, init) {
|
||||
Destructuring.prototype.buildVariableDeclaration = function (id, init) {
|
||||
var declar = t.variableDeclaration("var", [
|
||||
t.variableDeclarator(id, init)
|
||||
]);
|
||||
@@ -40,7 +40,7 @@ function Destructuring(opts) {
|
||||
return declar;
|
||||
};
|
||||
|
||||
Destructuring.prototype.push = function (elem, parentId) {
|
||||
Destructuring.prototype.push = function (elem, parentId) {
|
||||
if (t.isObjectPattern(elem)) {
|
||||
this.pushObjectPattern(elem, parentId);
|
||||
} else if (t.isArrayPattern(elem)) {
|
||||
@@ -52,7 +52,7 @@ function Destructuring(opts) {
|
||||
}
|
||||
};
|
||||
|
||||
Destructuring.prototype.pushAssignmentPattern = function (pattern, parentId) {
|
||||
Destructuring.prototype.pushAssignmentPattern = function (pattern, parentId) {
|
||||
var tempParentId = this.scope.generateUidBasedOnNode(parentId);
|
||||
|
||||
var declar = t.variableDeclaration("var", [
|
||||
@@ -167,7 +167,7 @@ Destructuring.prototype.pushArrayPattern = function (pattern, parentId) {
|
||||
}
|
||||
};
|
||||
|
||||
Destructuring.prototype.init = function (pattern, parentId) {
|
||||
Destructuring.prototype.init = function (pattern, parentId) {
|
||||
if (!t.isArrayExpression(parentId) && !t.isMemberExpression(parentId) && !t.isIdentifier(parentId)) {
|
||||
var key = this.scope.generateUidBasedOnNode(parentId);
|
||||
this.nodes.push(this.buildVariableDeclaration(key, parentId));
|
||||
|
||||
Reference in New Issue
Block a user