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 7.0.0-beta.1 to 7.0.0-beta.2

37

lib/generators/flow.js
"use strict";
exports.__esModule = true;
exports.StringLiteralTypeAnnotation = exports.NumberLiteralTypeAnnotation = exports.GenericTypeAnnotation = exports.ClassImplements = undefined;
exports.TypeParameterDeclaration = exports.StringLiteralTypeAnnotation = exports.NumberLiteralTypeAnnotation = exports.GenericTypeAnnotation = exports.ClassImplements = undefined;
exports.AnyTypeAnnotation = AnyTypeAnnotation;

@@ -54,2 +54,5 @@ exports.ArrayTypeAnnotation = ArrayTypeAnnotation;

exports.TypeAlias = TypeAlias;
exports.TypeAnnotation = TypeAnnotation;
exports.TypeParameterInstantiation = TypeParameterInstantiation;
exports.TypeParameter = TypeParameter;
exports.OpaqueType = OpaqueType;

@@ -389,2 +392,34 @@ exports.ObjectTypeAnnotation = ObjectTypeAnnotation;

function TypeAnnotation(node) {
this.token(":");
this.space();
if (node.optional) this.token("?");
this.print(node.typeAnnotation, node);
}
function TypeParameterInstantiation(node) {
this.token("<");
this.printList(node.params, node, {});
this.token(">");
}
exports.TypeParameterDeclaration = TypeParameterInstantiation;
function TypeParameter(node) {
this._variance(node);
this.word(node.name);
if (node.bound) {
this.print(node.bound, node);
}
if (node.default) {
this.space();
this.token("=");
this.space();
this.print(node.default, node);
}
}
function OpaqueType(node) {

@@ -391,0 +426,0 @@ this.word("opaque");

12

lib/generators/index.js

@@ -125,14 +125,2 @@ "use strict";

var _tsFlowCommon = require("./tsFlowCommon");
Object.keys(_tsFlowCommon).forEach(function (key) {
if (key === "default" || key === "__esModule") return;
Object.defineProperty(exports, key, {
enumerable: true,
get: function get() {
return _tsFlowCommon[key];
}
});
});
var _typescript = require("./typescript");

@@ -139,0 +127,0 @@

"use strict";
exports.__esModule = true;
exports.TSTypeAnnotation = TSTypeAnnotation;
exports.TSTypeParameterInstantiation = TSTypeParameterInstantiation;
exports.TSTypeParameter = TSTypeParameter;
exports.TSParameterProperty = TSParameterProperty;

@@ -61,2 +64,35 @@ exports.TSDeclareFunction = TSDeclareFunction;

function TSTypeAnnotation(node) {
this.token(":");
this.space();
if (node.optional) this.token("?");
this.print(node.typeAnnotation, node);
}
function TSTypeParameterInstantiation(node) {
this.token("<");
this.printList(node.params, node, {});
this.token(">");
}
exports.TSTypeParameterDeclaration = TSTypeParameterInstantiation;
function TSTypeParameter(node) {
this.word(node.name);
if (node.constraint) {
this.space();
this.word("extends");
this.space();
this.print(node.constraint, node);
}
if (node.default) {
this.space();
this.token("=");
this.space();
this.print(node.default, node);
}
}
function TSParameterProperty(node) {

@@ -63,0 +99,0 @@ if (node.accessibility) {

{
"name": "babel-generator",
"version": "7.0.0-beta.1",
"version": "7.0.0-beta.2",
"description": "Turns an AST into code.",

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

"dependencies": {
"babel-messages": "7.0.0-beta.1",
"babel-types": "7.0.0-beta.1",
"babel-messages": "7.0.0-beta.2",
"babel-types": "7.0.0-beta.2",
"jsesc": "^2.5.1",

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

"devDependencies": {
"babel-helper-fixtures": "7.0.0-beta.1",
"babylon": "^7.0.0-beta.22"
"babel-helper-fixtures": "7.0.0-beta.2",
"babylon": "^7.0.0-beta.25"
}
}
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