🐛 fix util types

This commit is contained in:
Flam3rboy 2021-08-13 20:54:16 +02:00
parent a772b32f6b
commit c687dedaa5
2 changed files with 2 additions and 2 deletions

View File

@ -41,7 +41,7 @@ class LongSchema extends mongoose.SchemaType {
if (type === "handle" || init == false) return val; if (type === "handle" || init == false) return val;
return BigInt(val.toString()); 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()); if (!Array.isArray(val) && val.toString) return BigInt(val.toString());
//@ts-ignore //@ts-ignore

View File

@ -1,3 +1,3 @@
export default function toBigInt(string: String): BigInt { export default function toBigInt(string: string): bigint {
return BigInt(string); return BigInt(string);
} }