Skip to content

Commit 3b1ece6

Browse files
Merge pull request #28 from leonardfactory/add-ts-big-int
✨ Add support for TSBigIntKeyword
2 parents 5f3fd6d + aebaef5 commit 3b1ece6

File tree

3 files changed

+4
-2
lines changed

3 files changed

+4
-2
lines changed

src/metadata/serializeType.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -176,6 +176,7 @@ function serializeTypeNode(className: string, node: t.TSType): SerializedType {
176176
}
177177

178178
case 'TSNumberKeyword':
179+
case 'TSBigIntKeyword' as any: // Still not in ``@babel/core` typings
179180
return t.identifier('Number');
180181

181182
case 'TSSymbolKeyword':

test/__fixtures__/type-serialization/code.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ class Sample {
4646
p14: (string | (string | null)),
4747
p15: Object,
4848
p16: any,
49+
p17: bigint,
4950
) {}
5051

5152
/**

test/__fixtures__/type-serialization/output.js

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ function _applyDecoratedDescriptor(target, property, decorators, descriptor, con
44

55
import { Decorate } from './Decorate';
66
const sym = Symbol();
7-
let Sample = (_dec = Decorate(), _dec2 = Reflect.metadata("design:paramtypes", [typeof String === "undefined" ? Object : String, typeof Number === "undefined" ? Object : Number, Number, String, Boolean, String, Number, typeof Object === "undefined" ? Object : Object, Function, String, Object, typeof Function === "undefined" ? Object : Function, void 0, void 0, Object, Function, Boolean, Boolean, String]), _dec3 = Reflect.metadata("design:paramtypes", [typeof Symbol === "undefined" ? Object : Symbol, Object, String, void 0, String, String, typeof Maybe === "undefined" ? Object : Maybe, Object, Object, Array, Array, void 0, Boolean, void 0, String, typeof Object === "undefined" ? Object : Object, Object]), _dec4 = Decorate(), _dec5 = Reflect.metadata("design:paramtypes", [typeof Decorate.Name === "undefined" ? Object : Decorate.Name, typeof Decorate.Name === "undefined" ? Object : Decorate.Name]), _dec6 = Decorate(), _dec7 = Reflect.metadata("design:paramtypes", [String]), _dec(_class = _dec2(_class = (_class2 = class Sample {
7+
let Sample = (_dec = Decorate(), _dec2 = Reflect.metadata("design:paramtypes", [typeof String === "undefined" ? Object : String, typeof Number === "undefined" ? Object : Number, Number, String, Boolean, String, Number, typeof Object === "undefined" ? Object : Object, Function, String, Object, typeof Function === "undefined" ? Object : Function, void 0, void 0, Object, Function, Boolean, Boolean, String]), _dec3 = Reflect.metadata("design:paramtypes", [typeof Symbol === "undefined" ? Object : Symbol, Object, String, void 0, String, String, typeof Maybe === "undefined" ? Object : Maybe, Object, Object, Array, Array, void 0, Boolean, void 0, String, typeof Object === "undefined" ? Object : Object, Object, Number]), _dec4 = Decorate(), _dec5 = Reflect.metadata("design:paramtypes", [typeof Decorate.Name === "undefined" ? Object : Decorate.Name, typeof Decorate.Name === "undefined" ? Object : Decorate.Name]), _dec6 = Decorate(), _dec7 = Reflect.metadata("design:paramtypes", [String]), _dec(_class = _dec2(_class = (_class2 = class Sample {
88
constructor(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17, p18 = 'abc') {
99
this.p0 = p0;
1010
}
1111

12-
method(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16) {}
12+
method(p0, p1, p2, p3, p4, p5, p6, p7, p8, p9, p10, p11, p12, p13, p14, p15, p16, p17) {}
1313
/**
1414
* Member Expression
1515
*/

0 commit comments

Comments
 (0)