babel-generator
Advanced tools
Comparing version 6.3.16 to 6.3.17
@@ -113,3 +113,3 @@ "use strict"; | ||
this.newline(true); | ||
if (this.format.compact && !this._lastPrintedIsEmptyStatement) { | ||
if (this.format.minified && !this._lastPrintedIsEmptyStatement) { | ||
this._removeLast(";"); | ||
@@ -116,0 +116,0 @@ } |
@@ -102,3 +102,3 @@ /* @flow */ | ||
this.print(node.callee, node); | ||
if (node.arguments.length === 0 && this.format.compact && !t.isCallExpression(parent, { callee: node }) && !t.isMemberExpression(parent) && !t.isNewExpression(parent)) return; | ||
if (node.arguments.length === 0 && this.format.minified && !t.isCallExpression(parent, { callee: node }) && !t.isMemberExpression(parent) && !t.isNewExpression(parent)) return; | ||
@@ -254,3 +254,3 @@ this.push("("); | ||
var val = undefined; | ||
if (this.format.compact) { | ||
if (this.format.minified) { | ||
val = this._stringLiteral(node.object); | ||
@@ -257,0 +257,0 @@ } else { |
@@ -90,2 +90,3 @@ "use strict"; | ||
compact: opts.compact, | ||
minified: opts.minified, | ||
concise: opts.concise, | ||
@@ -100,2 +101,6 @@ quotes: CodeGenerator.findCommonStringDelimiter(code, tokens), | ||
if (format.minified) { | ||
format.compact = true; | ||
} | ||
if (format.compact === "auto") { | ||
@@ -102,0 +107,0 @@ format.compact = code.length > 100000; // 100KB |
@@ -137,7 +137,7 @@ "use strict"; | ||
Printer.prototype._print = function _print(node, parent) { | ||
// In compact mode we need to produce as little bytes as needed | ||
// In minified mode we need to produce as little bytes as needed | ||
// and need to make sure that string quoting is consistent. | ||
// That means we have to always reprint as opposed to getting | ||
// the raw value. | ||
if (!this.format.compact) { | ||
if (!this.format.minified) { | ||
var extra = this.getPossibleRaw(node); | ||
@@ -292,3 +292,3 @@ if (extra) { | ||
} else { | ||
if (!this.format.compact && (comment.value.indexOf("@license") >= 0 || comment.value.indexOf("@preserve") >= 0)) { | ||
if (!this.format.minified && (comment.value.indexOf("@license") >= 0 || comment.value.indexOf("@preserve") >= 0)) { | ||
return true; | ||
@@ -295,0 +295,0 @@ } else { |
{ | ||
"name": "babel-generator", | ||
"version": "6.3.16", | ||
"version": "6.3.17", | ||
"description": "Turns an AST into code.", | ||
@@ -16,3 +16,3 @@ "author": "Sebastian McKenzie <sebmck@gmail.com>", | ||
"babel-runtime": "^5.0.0", | ||
"babel-types": "^6.3.14", | ||
"babel-types": "^6.3.17", | ||
"detect-indent": "^3.0.1", | ||
@@ -19,0 +19,0 @@ "is-integer": "^1.0.4", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
85079
2610
Updatedbabel-types@^6.3.17