Socket
Socket
Sign inDemoInstall

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.3.15 to 6.3.16

8

lib/generators/expressions.js

@@ -252,3 +252,9 @@ /* @flow */

if (t.isLiteral(node.object) && !t.isTemplateLiteral(node.object)) {
var val = this.getPossibleRaw(node.object) || this._stringLiteral(node.object);
var val = undefined;
if (this.format.compact) {
val = this._stringLiteral(node.object);
} else {
val = this.getPossibleRaw(node.object) || this._stringLiteral(node.object);
}
if (_isInteger2["default"](+val) && !SCIENTIFIC_NOTATION.test(val) && !ZERO_DECIMAL_INTEGER.test(val) && !this.endsWith(".")) {

@@ -255,0 +261,0 @@ this.push(".");

@@ -148,2 +148,6 @@ /* @flow */

if (t.isThrowStatement(parent)) {
return false;
}
// Otherwise err on the side of overparenthesization, adding

@@ -150,0 +154,0 @@ // explicit exceptions above if this proves overzealous.

23

lib/printer.js

@@ -137,10 +137,17 @@ "use strict";

Printer.prototype._print = function _print(node, parent) {
var extra = this.getPossibleRaw(node);
if (extra) {
this.push("");
this._push(extra);
} else {
var printMethod = this[node.type];
printMethod.call(this, node, parent);
// In compact 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) {
var extra = this.getPossibleRaw(node);
if (extra) {
this.push("");
this._push(extra);
return;
}
}
var printMethod = this[node.type];
printMethod.call(this, node, parent);
};

@@ -285,3 +292,3 @@

} else {
if (comment.value.indexOf("@license") >= 0 || comment.value.indexOf("@preserve") >= 0) {
if (!this.format.compact && (comment.value.indexOf("@license") >= 0 || comment.value.indexOf("@preserve") >= 0)) {
return true;

@@ -288,0 +295,0 @@ } else {

{
"name": "babel-generator",
"version": "6.3.15",
"version": "6.3.16",
"description": "Turns an AST into code.",

@@ -5,0 +5,0 @@ "author": "Sebastian McKenzie <sebmck@gmail.com>",

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