@babel/generator
Advanced tools
Comparing version 7.21.1 to 7.21.3
@@ -238,3 +238,6 @@ "use strict"; | ||
exactSource(loc, cb) { | ||
if (!this._map) return cb(); | ||
if (!this._map) { | ||
cb(); | ||
return; | ||
} | ||
this.source("start", loc); | ||
@@ -264,4 +267,5 @@ const identifierName = loc.identifierName; | ||
withSource(prop, loc, cb) { | ||
if (!this._map) return cb(); | ||
this.source(prop, loc); | ||
if (this._map) { | ||
this.source(prop, loc); | ||
} | ||
cb(); | ||
@@ -268,0 +272,0 @@ } |
@@ -178,6 +178,4 @@ "use strict"; | ||
} | ||
const val = _jsesc(node.value, Object.assign(this.format.jsescOption, this.format.jsonCompatibleStrings && { | ||
json: true | ||
})); | ||
return this.token(val); | ||
const val = _jsesc(node.value, this.format.jsescOption); | ||
this.token(val); | ||
} | ||
@@ -184,0 +182,0 @@ function BigIntLiteral(node) { |
@@ -47,3 +47,3 @@ "use strict"; | ||
format.decoratorsBeforeExport = opts.decoratorsBeforeExport; | ||
format.jsonCompatibleStrings = opts.jsonCompatibleStrings; | ||
format.jsescOption.json = opts.jsonCompatibleStrings; | ||
} | ||
@@ -57,3 +57,3 @@ if (format.minified) { | ||
if (format.compact === "auto") { | ||
format.compact = code.length > 500000; | ||
format.compact = typeof code === "string" && code.length > 500000; | ||
if (format.compact) { | ||
@@ -60,0 +60,0 @@ console.error("[BABEL] Note: The code generator has deoptimised the styling of " + `${opts.filename} as it exceeds the max of ${"500KB"}.`); |
@@ -11,2 +11,3 @@ "use strict"; | ||
var generatorFunctions = require("./generators"); | ||
require("@jridgewell/trace-mapping"); | ||
const { | ||
@@ -154,3 +155,6 @@ isFunction, | ||
exactSource(loc, cb) { | ||
if (!loc) return cb(); | ||
if (!loc) { | ||
cb(); | ||
return; | ||
} | ||
this._catchUp("start", loc); | ||
@@ -170,3 +174,6 @@ this._buf.exactSource(loc, cb); | ||
withSource(prop, loc, cb) { | ||
if (!loc) return cb(); | ||
if (!loc) { | ||
cb(); | ||
return; | ||
} | ||
this._catchUp(prop, loc); | ||
@@ -461,3 +468,3 @@ this._buf.withSource(prop, loc, cb); | ||
opts.statement = true; | ||
return this.printJoin(nodes, parent, opts); | ||
this.printJoin(nodes, parent, opts); | ||
} | ||
@@ -468,3 +475,3 @@ printList(items, parent, opts = {}) { | ||
} | ||
return this.printJoin(items, parent, opts); | ||
this.printJoin(items, parent, opts); | ||
} | ||
@@ -471,0 +478,0 @@ _printNewline(newLine, opts) { |
{ | ||
"name": "@babel/generator", | ||
"version": "7.21.1", | ||
"version": "7.21.3", | ||
"description": "Turns an AST into code.", | ||
@@ -22,3 +22,3 @@ "author": "The Babel Team (https://babel.dev/team)", | ||
"dependencies": { | ||
"@babel/types": "^7.21.0", | ||
"@babel/types": "^7.21.3", | ||
"@jridgewell/gen-mapping": "^0.3.2", | ||
@@ -30,3 +30,3 @@ "@jridgewell/trace-mapping": "^0.3.17", | ||
"@babel/helper-fixtures": "^7.21.0", | ||
"@babel/parser": "^7.21.1", | ||
"@babel/parser": "^7.21.3", | ||
"@types/jsesc": "^2.5.0", | ||
@@ -33,0 +33,0 @@ "charcodes": "^0.2.0" |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
477640
4738
Updated@babel/types@^7.21.3