Skip to content

Commit

Permalink
fix: Literal should support bigint type (#226)
Browse files Browse the repository at this point in the history
  • Loading branch information
fengmk2 authored Nov 12, 2021
1 parent e8a524a commit 4ba60e7
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
4 changes: 3 additions & 1 deletion test/types/basics.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ describe('=> Basics (TypeScript)', function() {
}

// TODO: should be generated or automated with decorator
id: number;
id: bigint;
createdAt: Date;
updatedAt: Date;
deletedAt: Date;
Expand Down Expand Up @@ -135,6 +135,8 @@ describe('=> Basics (TypeScript)', function() {
it('Post.findOne()', async function() {
const post = await Post.findOne({ title: 'Leah' });
assert.equal(post.title, 'Leah');
const post1 = await Post.findOne({ id: post.id });
assert.equal(post1.id, post.id);
});

it('Post.where()', async function() {
Expand Down
2 changes: 1 addition & 1 deletion types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ export class Spell<T extends typeof Bone, U = InstanceType<T> | Collection<Insta
toString(): string;
}

type Literal = null | undefined | boolean | number | string | Date | object | ArrayBuffer;
type Literal = null | undefined | boolean | number | bigint | string | Date | object | ArrayBuffer;

type OperatorCondition = {
[key in '$eq' | '$ne']?: Literal;
Expand Down

0 comments on commit 4ba60e7

Please sign in to comment.