import { validate } from "@std/uuid/v7"; import type { BRAND } from "zod"; export type UuidString = `${string}-${string}-7${string}-${string}-${string}`; export type Id = UuidString & BRAND<`${For}.id`>; export function parseId>(value: string): T { if (!validate(value)) { throw new Error(`Invalid UUIDv7: ${value}`); } return value as T; }