diff options
Diffstat (limited to 'util/src')
-rw-r--r-- | util/src/util/MongoBigInt.ts | 2 | ||||
-rw-r--r-- | util/src/util/toBigInt.ts | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/util/src/util/MongoBigInt.ts b/util/src/util/MongoBigInt.ts index fc451925..5148b742 100644 --- a/util/src/util/MongoBigInt.ts +++ b/util/src/util/MongoBigInt.ts @@ -41,7 +41,7 @@ class LongSchema extends mongoose.SchemaType { if (type === "handle" || init == false) return val; return BigInt(val.toString()); } - if (val instanceof Number || "number" == typeof val) return BigInt(val); + if (val instanceof Number || "number" == typeof val) return BigInt(val as number); if (!Array.isArray(val) && val.toString) return BigInt(val.toString()); //@ts-ignore diff --git a/util/src/util/toBigInt.ts b/util/src/util/toBigInt.ts index d57c4568..b7985928 100644 --- a/util/src/util/toBigInt.ts +++ b/util/src/util/toBigInt.ts @@ -1,3 +1,4 @@ -export default function toBigInt(string: String): BigInt { +export default function toBigInt(string: string): bigint { return BigInt(string); } + |