Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

babel-generator

Package Overview
Dependencies
Maintainers
6
Versions
94
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

babel-generator - npm Package Compare versions

Comparing version 6.4.2 to 6.4.3

lib/node/flycheck_parentheses.js

4

lib/generators/statements.js

@@ -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)
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc