hezarfen_frontend
Clone
https://git.tahinli.com/archive/hezarfen_frontend.git
0 watching0 forksTypeScript5.5 MiB5fcd955Burak Boduroğlu2 months ago730 commits
| 1 | import { uuidV7Ms } from "./uuid-time"; |
| 2 | |
| 3 | describe("uuidV7Ms", () => { |
| 4 | it("reads the unix-ms prefix of a v7 id", () => { |
| 5 | expect(uuidV7Ms("01a0b1b0-aca9-7025-b739-d3ad153d617b")).toBe(0x01a0b1b0aca9); |
| 6 | }); |
| 7 | |
| 8 | it("orders ids created later after earlier ones", () => { |
| 9 | expect(uuidV7Ms("01a0b1b0-aca9-7025-b739-d3ad153d617b")!).toBeLessThan(uuidV7Ms("01a0b1b1-0000-7000-8000-000000000000")!); |
| 10 | }); |
| 11 | |
| 12 | it("returns null for a non-v7 id", () => { |
| 13 | expect(uuidV7Ms("123e4567-e89b-42d3-a456-426614174000")).toBeNull(); |
| 14 | expect(uuidV7Ms("not-an-id")).toBeNull(); |
| 15 | }); |
| 16 | }); |