babel-generator
Advanced tools
Comparing version 7.0.0-beta.1 to 7.0.0-beta.2
"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"); |
@@ -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" | ||
} | ||
} |
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
105258
3354
21
+ Addedbabel-messages@7.0.0-beta.2(transitive)
+ Addedbabel-types@7.0.0-beta.2(transitive)
- Removedbabel-messages@7.0.0-beta.1(transitive)
- Removedbabel-types@7.0.0-beta.1(transitive)
Updatedbabel-messages@7.0.0-beta.2
Updatedbabel-types@7.0.0-beta.2