Socket
Socket
Sign inDemoInstall

babel-generator

Package Overview
Dependencies
Maintainers
4
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 7.0.0-alpha.16 to 7.0.0-alpha.17

7

lib/generators/statements.js

@@ -141,4 +141,7 @@ "use strict";

function buildLabelStatement(prefix) {
var key = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : "label";
function buildLabelStatement(prefix, key) {
if (key === void 0) {
key = "label";
}
return function (node) {

@@ -145,0 +148,0 @@ this.word(prefix);

@@ -32,8 +32,9 @@ "use strict";

function Generator(ast) {
var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
function Generator(ast, opts, code) {
var _this;
var code = arguments[2];
if (opts === void 0) {
opts = {};
}
var format = normalizeOptions(code, opts);

@@ -40,0 +41,0 @@ var map = opts.sourceMaps ? new _sourceMap2.default(opts, code) : null;

@@ -34,6 +34,6 @@ "use strict";

var _Object$keys = Object.keys(obj);
var _arr = Object.keys(obj);
for (var _i = 0; _i < _Object$keys.length; _i++) {
var type = _Object$keys[_i];
for (var _i = 0; _i < _arr.length; _i++) {
var type = _arr[_i];
var aliases = t.FLIPPED_ALIAS_KEYS[type];

@@ -54,4 +54,4 @@

var alias = _ref;
add(alias, obj[type]);
var _alias = _ref;
add(_alias, obj[type]);
}

@@ -58,0 +58,0 @@ } else {

@@ -163,4 +163,4 @@ "use strict";

function isFirstInStatement(printStack) {
var _ref = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {},
function isFirstInStatement(printStack, _temp) {
var _ref = _temp === void 0 ? {} : _temp,
_ref$considerArrow = _ref.considerArrow,

@@ -167,0 +167,0 @@ considerArrow = _ref$considerArrow === undefined ? false : _ref$considerArrow,

@@ -18,4 +18,6 @@ "use strict";

function crawl(node) {
var state = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
function crawl(node, state) {
if (state === void 0) {
state = {};
}

@@ -22,0 +24,0 @@ if (t.isMemberExpression(node)) {

@@ -73,4 +73,6 @@ "use strict";

Printer.prototype.semicolon = function semicolon() {
var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
Printer.prototype.semicolon = function semicolon(force) {
if (force === void 0) {
force = false;
}

@@ -90,4 +92,7 @@ this._maybeAddAuxComment();

Printer.prototype.space = function space() {
var force = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
Printer.prototype.space = function space(force) {
if (force === void 0) {
force = false;
}
if (this.format.compact) return;

@@ -172,4 +177,6 @@

Printer.prototype._append = function _append(str) {
var queue = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : false;
Printer.prototype._append = function _append(str, queue) {
if (queue === void 0) {
queue = false;
}

@@ -228,4 +235,6 @@ this._maybeAddParen(str);

Printer.prototype.startTerminatorless = function startTerminatorless() {
var isLabel = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : false;
Printer.prototype.startTerminatorless = function startTerminatorless(isLabel) {
if (isLabel === void 0) {
isLabel = false;
}

@@ -339,4 +348,7 @@ if (isLabel) {

Printer.prototype.printJoin = function printJoin(nodes, parent) {
var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
Printer.prototype.printJoin = function printJoin(nodes, parent, opts) {
if (opts === void 0) {
opts = {};
}
if (!nodes || !nodes.length) return;

@@ -393,4 +405,7 @@ if (opts.indent) this.indent();

Printer.prototype.printInnerComments = function printInnerComments(node) {
var indent = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : true;
Printer.prototype.printInnerComments = function printInnerComments(node, indent) {
if (indent === void 0) {
indent = true;
}
if (!node.innerComments) return;

@@ -404,4 +419,7 @@ if (indent) this.indent();

Printer.prototype.printSequence = function printSequence(nodes, parent) {
var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
Printer.prototype.printSequence = function printSequence(nodes, parent, opts) {
if (opts === void 0) {
opts = {};
}
opts.statement = true;

@@ -411,4 +429,6 @@ return this.printJoin(nodes, parent, opts);

Printer.prototype.printList = function printList(items, parent) {
var opts = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {};
Printer.prototype.printList = function printList(items, parent, opts) {
if (opts === void 0) {
opts = {};
}

@@ -499,5 +519,5 @@ if (opts.separator == null) {

var _comment = _ref;
var _comment2 = _ref;
this._printComment(_comment);
this._printComment(_comment2);
}

@@ -504,0 +524,0 @@ };

@@ -32,3 +32,3 @@ "use strict";

map.setSourceContent(this._opts.sourceFileName, code);
} else if ((typeof code === "undefined" ? "undefined" : _typeof(code)) === "object") {
} else if (_typeof(code) === "object") {
Object.keys(code).forEach(function (sourceFileName) {

@@ -35,0 +35,0 @@ map.setSourceContent(sourceFileName, code[sourceFileName]);

{
"name": "babel-generator",
"version": "7.0.0-alpha.16",
"version": "7.0.0-alpha.17",
"description": "Turns an AST into code.",

@@ -14,4 +14,4 @@ "author": "Sebastian McKenzie <sebmck@gmail.com>",

"dependencies": {
"babel-messages": "7.0.0-alpha.16",
"babel-types": "7.0.0-alpha.16",
"babel-messages": "7.0.0-alpha.17",
"babel-types": "7.0.0-alpha.17",
"jsesc": "^2.5.1",

@@ -23,5 +23,5 @@ "lodash": "^4.2.0",

"devDependencies": {
"babel-helper-fixtures": "7.0.0-alpha.16",
"babylon": "^7.0.0-beta.17"
"babel-helper-fixtures": "7.0.0-alpha.17",
"babylon": "^7.0.0-beta.18"
}
}
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