babel-generator
Advanced tools
Comparing version 6.18.0 to 6.19.0
@@ -49,7 +49,7 @@ "use strict"; | ||
this._flush(); | ||
var _sourcePosition = this._sourcePosition; | ||
var line = _sourcePosition.line; | ||
var column = _sourcePosition.column; | ||
var filename = _sourcePosition.filename; | ||
var identifierName = _sourcePosition.identifierName; | ||
var _sourcePosition = this._sourcePosition, | ||
line = _sourcePosition.line, | ||
column = _sourcePosition.column, | ||
filename = _sourcePosition.filename, | ||
identifierName = _sourcePosition.identifierName; | ||
@@ -62,7 +62,7 @@ this._append(str, line, column, identifierName, filename); | ||
this._queue.shift(); | ||
}var _sourcePosition2 = this._sourcePosition; | ||
var line = _sourcePosition2.line; | ||
var column = _sourcePosition2.column; | ||
var filename = _sourcePosition2.filename; | ||
var identifierName = _sourcePosition2.identifierName; | ||
}var _sourcePosition2 = this._sourcePosition, | ||
line = _sourcePosition2.line, | ||
column = _sourcePosition2.column, | ||
filename = _sourcePosition2.filename, | ||
identifierName = _sourcePosition2.identifierName; | ||
@@ -69,0 +69,0 @@ this._queue.unshift([str, line, column, identifierName, filename]); |
@@ -328,3 +328,7 @@ "use strict"; | ||
if (props.length !== 1) { | ||
_this.semicolon(); | ||
if (_this.format.flowCommaSeparator) { | ||
_this.token(","); | ||
} else { | ||
_this.semicolon(); | ||
} | ||
_this.space(); | ||
@@ -331,0 +335,0 @@ } |
@@ -131,4 +131,10 @@ "use strict"; | ||
var raw = this.getPossibleRaw(node); | ||
this.number(raw == null ? node.value + "" : raw); | ||
var value = node.value + ""; | ||
if (raw == null) { | ||
this.number(value); | ||
} else if (this.format.minified) { | ||
this.number(raw.length < value.length ? raw : value); | ||
} else { | ||
this.number(raw); | ||
} | ||
} | ||
@@ -138,3 +144,3 @@ | ||
var raw = this.getPossibleRaw(node); | ||
if (raw != null) { | ||
if (!this.format.minified && raw != null) { | ||
this.token(raw); | ||
@@ -144,8 +150,12 @@ return; | ||
var val = (0, _jsesc2.default)(node.value, { | ||
var opts = { | ||
quotes: t.isJSX(parent) ? "double" : this.format.quotes, | ||
wrap: true | ||
}); | ||
}; | ||
if (this.format.jsonCompatibleStrings) { | ||
opts.json = true; | ||
} | ||
var val = (0, _jsesc2.default)(node.value, opts); | ||
return this.token(val); | ||
} |
@@ -86,2 +86,3 @@ "use strict"; | ||
quotes: opts.quotes || findCommonStringDelimiter(code, tokens), | ||
jsonCompatibleStrings: opts.jsonCompatibleStrings, | ||
indent: { | ||
@@ -91,3 +92,4 @@ adjustMultilineComment: true, | ||
base: 0 | ||
} | ||
}, | ||
flowCommaSeparator: opts.flowCommaSeparator | ||
}; | ||
@@ -94,0 +96,0 @@ |
@@ -217,9 +217,8 @@ "use strict"; | ||
function isFirstInStatement(printStack) { | ||
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}; | ||
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {}, | ||
_ref$considerArrow = _ref.considerArrow, | ||
considerArrow = _ref$considerArrow === undefined ? false : _ref$considerArrow, | ||
_ref$considerDefaultE = _ref.considerDefaultExports, | ||
considerDefaultExports = _ref$considerDefaultE === undefined ? false : _ref$considerDefaultE; | ||
var _ref$considerArrow = _ref.considerArrow; | ||
var considerArrow = _ref$considerArrow === undefined ? false : _ref$considerArrow; | ||
var _ref$considerDefaultE = _ref.considerDefaultExports; | ||
var considerDefaultExports = _ref$considerDefaultE === undefined ? false : _ref$considerDefaultE; | ||
var i = printStack.length - 1; | ||
@@ -226,0 +225,0 @@ var node = printStack[i]; |
@@ -343,4 +343,2 @@ "use strict"; | ||
Printer.prototype.getPossibleRaw = function getPossibleRaw(node) { | ||
if (this.format.minified) return; | ||
var extra = node.extra; | ||
@@ -347,0 +345,0 @@ if (extra && extra.raw != null && extra.rawValue != null && node.value === extra.rawValue) { |
{ | ||
"name": "babel-generator", | ||
"version": "6.18.0", | ||
"version": "6.19.0", | ||
"description": "Turns an AST into code.", | ||
@@ -16,3 +16,3 @@ "author": "Sebastian McKenzie <sebmck@gmail.com>", | ||
"babel-runtime": "^6.9.0", | ||
"babel-types": "^6.18.0", | ||
"babel-types": "^6.19.0", | ||
"detect-indent": "^4.0.0", | ||
@@ -19,0 +19,0 @@ "jsesc": "^1.3.0", |
@@ -40,3 +40,4 @@ # babel-generator | ||
filename | string | | Used in warning messages | ||
flowCommaSeparator | boolean | `false` | Set to `true` to use commas instead of semicolons as Flow property separators | ||
jsonCompatibleStrings | boolean | `false` | Set to true to run `jsesc` with "json": true to print "\u00A9" vs. "©"; | ||
Options for source maps: | ||
@@ -43,0 +44,0 @@ |
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
90551
2659
86
Updatedbabel-types@^6.19.0