Skip to content

Commit

Permalink
feat: bigint support (#1828)
Browse files Browse the repository at this point in the history
  • Loading branch information
marcus-josendal authored Dec 5, 2023
1 parent 2845b6c commit f5cb7c0
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/NodeParser/NumberTypeNodeParser.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { NumberType } from "../Type/NumberType";

export class NumberTypeNodeParser implements SubNodeParser {
public supportsNode(node: ts.KeywordTypeNode): boolean {
return node.kind === ts.SyntaxKind.NumberKeyword;
return node.kind === ts.SyntaxKind.NumberKeyword || node.kind === ts.SyntaxKind.BigIntKeyword;
}
public createType(node: ts.KeywordTypeNode, context: Context): BaseType {
return new NumberType();
Expand Down
1 change: 1 addition & 0 deletions test/valid-data/type-primitives/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ export interface MyObject {
boolean: boolean;
number: number;
string: string;
bigint: bigint;

integer: integer;
double: double;
Expand Down
4 changes: 4 additions & 0 deletions test/valid-data/type-primitives/schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,12 +25,16 @@
},
"string": {
"type": "string"
},
"bigint": {
"type": "number"
}
},
"required": [
"boolean",
"number",
"string",
"bigint",
"integer",
"double",
"decimal",
Expand Down

0 comments on commit f5cb7c0

Please sign in to comment.