@babel/plugin-transform-typescript
Advanced tools
Comparing version 8.0.0-alpha.0 to 8.0.0-alpha.1
@@ -122,7 +122,9 @@ import { template, types as t } from "@babel/core"; | ||
seen.set(name, constValue); | ||
if (typeof constValue === "number") { | ||
value = t.numericLiteral(constValue); | ||
assert(typeof constValue === "number" || typeof constValue === "string"); | ||
if (constValue === Infinity || Number.isNaN(constValue)) { | ||
value = t.identifier(String(constValue)); | ||
} else if (constValue === -Infinity) { | ||
value = t.unaryExpression("-", t.identifier("Infinity")); | ||
} else { | ||
assert(typeof constValue === "string"); | ||
value = t.stringLiteral(constValue); | ||
value = t.valueToNode(constValue); | ||
} | ||
@@ -129,0 +131,0 @@ } else { |
@@ -126,7 +126,9 @@ import { declare } from '@babel/helper-plugin-utils'; | ||
seen.set(name, constValue); | ||
if (typeof constValue === "number") { | ||
value = t.numericLiteral(constValue); | ||
assert(typeof constValue === "number" || typeof constValue === "string"); | ||
if (constValue === Infinity || Number.isNaN(constValue)) { | ||
value = t.identifier(String(constValue)); | ||
} else if (constValue === -Infinity) { | ||
value = t.unaryExpression("-", t.identifier("Infinity")); | ||
} else { | ||
assert(typeof constValue === "string"); | ||
value = t.stringLiteral(constValue); | ||
value = t.valueToNode(constValue); | ||
} | ||
@@ -133,0 +135,0 @@ } else { |
{ | ||
"name": "@babel/plugin-transform-typescript", | ||
"version": "8.0.0-alpha.0", | ||
"version": "8.0.0-alpha.1", | ||
"description": "Transform TypeScript into ES.next", | ||
@@ -20,15 +20,15 @@ "repository": { | ||
"dependencies": { | ||
"@babel/helper-annotate-as-pure": "^8.0.0-alpha.0", | ||
"@babel/helper-create-class-features-plugin": "^8.0.0-alpha.0", | ||
"@babel/helper-plugin-utils": "^8.0.0-alpha.0", | ||
"@babel/plugin-syntax-typescript": "^8.0.0-alpha.0" | ||
"@babel/helper-annotate-as-pure": "^8.0.0-alpha.1", | ||
"@babel/helper-create-class-features-plugin": "^8.0.0-alpha.1", | ||
"@babel/helper-plugin-utils": "^8.0.0-alpha.1", | ||
"@babel/plugin-syntax-typescript": "^8.0.0-alpha.1" | ||
}, | ||
"peerDependencies": { | ||
"@babel/core": "^8.0.0-alpha.0" | ||
"@babel/core": "^8.0.0-alpha.1" | ||
}, | ||
"devDependencies": { | ||
"@babel/core": "^8.0.0-alpha.0", | ||
"@babel/helper-plugin-test-runner": "^8.0.0-alpha.0", | ||
"@babel/traverse": "^8.0.0-alpha.0", | ||
"@babel/types": "^8.0.0-alpha.0" | ||
"@babel/core": "^8.0.0-alpha.1", | ||
"@babel/helper-plugin-test-runner": "^8.0.0-alpha.1", | ||
"@babel/traverse": "^8.0.0-alpha.1", | ||
"@babel/types": "^8.0.0-alpha.1" | ||
}, | ||
@@ -35,0 +35,0 @@ "homepage": "https://babel.dev/docs/en/next/babel-plugin-transform-typescript", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
191231
1458