mirror of
https://github.com/swc-project/swc.git
synced 2024-12-24 14:16:12 +03:00
11 lines
282 B
TypeScript
11 lines
282 B
TypeScript
// Loaded from https://deno.land/x/discordeno@11.0.0-rc.2/src/util/bigint.ts
|
|
|
|
|
|
export function snowflakeToBigint(snowflake: string) {
|
|
return BigInt(snowflake) | 0n;
|
|
}
|
|
|
|
export function bigintToSnowflake(snowflake: bigint) {
|
|
return snowflake === 0n ? "" : snowflake.toString();
|
|
}
|