File
Blob: src/shared/page-id.ts
| 1 | import { z } from "zod"; |
| 2 | |
| 3 | // ULID/Crockford base32, 26 characters. Mirrors the encoding produced by |
| 4 | // `ulid()` in `seedPage` and the page-creation routes. |
| 5 | export const PAGE_ID_PATTERN = /^[0-9A-HJKMNP-TV-Z]{26}$/i; |
| 6 | |
| 7 | export const pageId = z.string().regex(PAGE_ID_PATTERN, "page_id must be a 26-character ULID"); |