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.21.0 to 6.22.0

8

lib/generators/expressions.js

@@ -25,6 +25,2 @@ "use strict";

var _isNumber = require("lodash/isNumber");
var _isNumber2 = _interopRequireDefault(_isNumber);
var _babelTypes = require("babel-types");

@@ -40,4 +36,2 @@

function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
function UnaryExpression(node) {

@@ -231,3 +225,3 @@ if (node.operator === "void" || node.operator === "delete" || node.operator === "typeof") {

var computed = node.computed;
if (t.isLiteral(node.property) && (0, _isNumber2.default)(node.property.value)) {
if (t.isLiteral(node.property) && typeof node.property.value === "number") {
computed = true;

@@ -234,0 +228,0 @@ }

5

lib/generators/modules.js

@@ -22,2 +22,7 @@ "use strict";

function ImportSpecifier(node) {
if (node.importKind === "type" || node.importKind === "typeof") {
this.word(node.importKind);
this.space();
}
this.print(node.imported, node);

@@ -24,0 +29,0 @@ if (node.local && node.local.name !== node.imported.name) {

@@ -18,5 +18,3 @@ "use strict";

if (!isFirst) this.space();
this.token(value);
if (!isLast) this.space();
}

@@ -23,0 +21,0 @@

"use strict";
var _isBoolean = require("lodash/isBoolean");
var _isBoolean2 = _interopRequireDefault(_isBoolean);
var _each = require("lodash/each");
var _each2 = _interopRequireDefault(_each);
var _map = require("lodash/map");

@@ -147,15 +139,10 @@

(0, _each2.default)({
Function: true,
Class: true,
Loop: true,
LabeledStatement: true,
SwitchStatement: true,
TryStatement: true
}, function (amounts, type) {
if ((0, _isBoolean2.default)(amounts)) {
[["Function", true], ["Class", true], ["Loop", true], ["LabeledStatement", true], ["SwitchStatement", true], ["TryStatement", true]].forEach(function (_ref) {
var type = _ref[0],
amounts = _ref[1];
if (typeof amounts === "boolean") {
amounts = { after: amounts, before: amounts };
}
(0, _each2.default)([type].concat(t.FLIPPED_ALIAS_KEYS[type] || []), function (type) {
[type].concat(t.FLIPPED_ALIAS_KEYS[type] || []).forEach(function (type) {
exports.nodes[type] = function () {

@@ -162,0 +149,0 @@ return amounts;

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

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

"dependencies": {
"babel-messages": "^6.8.0",
"babel-runtime": "^6.20.0",
"babel-types": "^6.21.0",
"babel-messages": "^6.22.0",
"babel-runtime": "^6.22.0",
"babel-types": "^6.22.0",
"detect-indent": "^4.0.0",

@@ -24,5 +24,5 @@ "jsesc": "^1.3.0",

"devDependencies": {
"babel-helper-fixtures": "^6.20.0",
"babel-helper-fixtures": "^6.22.0",
"babylon": "^6.11.0"
}
}
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