babel-generator
Advanced tools
Comparing version 6.4.2 to 6.4.3
@@ -32,2 +32,4 @@ "use strict"; | ||
var NON_ALPHABETIC_UNARY_OPERATORS = t.UPDATE_OPERATORS.concat(t.NUMBER_UNARY_OPERATORS).concat(["!"]); | ||
function WithStatement(node /*: Object*/) { | ||
@@ -144,3 +146,3 @@ this.keyword("with"); | ||
if (label) { | ||
if (!(this.format.minified && (t.isUnaryExpression(label, { prefix: true }) || t.isUpdateExpression(label, { prefix: true })))) { | ||
if (!(this.format.minified && (t.isUnaryExpression(label, { prefix: true }) || t.isUpdateExpression(label, { prefix: true })) && NON_ALPHABETIC_UNARY_OPERATORS.indexOf(label.operator) > -1)) { | ||
this.push(" "); | ||
@@ -147,0 +149,0 @@ } |
{ | ||
"name": "babel-generator", | ||
"version": "6.4.2", | ||
"version": "6.4.3", | ||
"description": "Turns an AST into code.", | ||
@@ -16,3 +16,3 @@ "author": "Sebastian McKenzie <sebmck@gmail.com>", | ||
"babel-runtime": "^5.0.0", | ||
"babel-types": "^6.4.1", | ||
"babel-types": "^6.4.3", | ||
"detect-indent": "^3.0.1", | ||
@@ -19,0 +19,0 @@ "is-integer": "^1.0.4", |
@@ -22,1 +22,27 @@ # babel-generator | ||
``` | ||
## Options | ||
Options for formatting output: | ||
name | type | default | description | ||
-----------------------|----------|-----------------|-------------------------------------------------------------------------- | ||
auxiliaryCommentBefore | string | | Optional string to add as a block comment at the start of the output file | ||
auxiliaryCommentAfter | string | | Optional string to add as a block comment at the end of the output file | ||
shouldPrintComment | function | `opts.comments` | Function that takes a comment (as a string) and returns `true` if the comment should be included in the output. By default, comments are included if `opts.comments` is `true` or if `opts.minifed` is `false` and the comment contains `@preserve` or `@license` | ||
retainLines | boolean | `false` | Attempt to use the same line numbers in the output code as in the source code (helps preserve stack traces) | ||
comments | boolean | `true` | Should comments be included in output | ||
compact | boolean or `'auto'` | `opts.minified` | Set to `true` to avoid adding whitespace for formatting | ||
minified | boolean | `false` | Should the output be minified | ||
concise | boolean | `false` | Set to `true` to reduce whitespace (but not as much as `opts.compact`) | ||
quotes | `'single'` or `'double'` | autodetect based on `ast.tokens` | The type of quote to use in the output | ||
filename | string | | Used in warning messages | ||
Options for source maps: | ||
name | type | default | description | ||
-----------------------|----------|-----------------|-------------------------------------------------------------------------- | ||
sourceMaps | boolean | `false` | Enable generating source maps | ||
sourceMapTarget | string | | The filename of the generated code that the source map will be associated with | ||
sourceRoot | string | | A root for all relative URLs in the source map | ||
sourceFileName | string | | The filename for the source code (i.e. the code in the `code` argument) |
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
96372
22
2899
48
Updatedbabel-types@^6.4.3