refactor: unwrap Identifier namespace + self-reexport (#22963)
This commit is contained in:
parent
23d48a7cf1
commit
e2d161dfdd
1 changed files with 66 additions and 66 deletions
|
|
@ -1,7 +1,6 @@
|
||||||
import z from "zod"
|
import z from "zod"
|
||||||
import { randomBytes } from "crypto"
|
import { randomBytes } from "crypto"
|
||||||
|
|
||||||
export namespace Identifier {
|
|
||||||
const prefixes = {
|
const prefixes = {
|
||||||
event: "evt",
|
event: "evt",
|
||||||
session: "ses",
|
session: "ses",
|
||||||
|
|
@ -83,4 +82,5 @@ export namespace Identifier {
|
||||||
const encoded = BigInt("0x" + hex)
|
const encoded = BigInt("0x" + hex)
|
||||||
return Number(encoded / BigInt(0x1000))
|
return Number(encoded / BigInt(0x1000))
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
export * as Identifier from "./id"
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue