core-types-ts
Advanced tools
Comparing version 3.0.0 to 3.1.0
@@ -283,4 +283,13 @@ "use strict"; | ||
return { type: 'null', ...(0, ts_annotations_1.decorateNode)(node) }; | ||
else if (node.literal.kind === ts.SyntaxKind.PrefixUnaryExpression) | ||
return ctx.handleError(ctx.getUnsupportedError("Prefix unary expressions not supported", node.literal)); | ||
else if (node.literal.kind === ts.SyntaxKind.PrefixUnaryExpression) { | ||
if ("operand" in node.literal && | ||
node.literal.operator === ts.SyntaxKind.MinusToken) { | ||
return { | ||
type: 'number', | ||
const: -Number(node.literal.operand.getText()), | ||
...(0, ts_annotations_1.decorateNode)(node), | ||
}; | ||
} | ||
return ctx.handleError(ctx.getUnsupportedError("Prefix unary expressions is only supported for MinusToken", node.literal)); | ||
} | ||
return ctx.handleError(ctx.getUnsupportedError("Literal type not understood", node.literal)); | ||
@@ -287,0 +296,0 @@ } |
{ | ||
"name": "core-types-ts", | ||
"version": "3.0.0", | ||
"version": "3.1.0", | ||
"description": "core-types ⬌ TypeScript interface conversion", | ||
@@ -5,0 +5,0 @@ "author": "Gustaf Räntilä", |
45056
869