Schemas
Zod schemas for Unicode data files
Schemas
Zod schemas that define the shared data contracts across the UCD.js monorepo — API responses, store manifests, lockfiles, and Unicode metadata.
Installation
npm install @ucdjs/schemasOverview
The @ucdjs/schemas package provides Zod schemas for validating Unicode data files, API responses, and internal configurations with full type safety. All schemas are exported from the package root.
Usage
import { LockfileSchema, UnicodeVersionSchema } from "@ucdjs/schemas";
// Parse a Unicode version object
const version = UnicodeVersionSchema.parse(rawVersion);
// Safely parse a lockfile
const result = LockfileSchema.safeParse(rawLockfile);
if (result.success) {
console.log(result.data.versions);
}Available Schemas
| Schema Family | Key Exports | Description |
|---|---|---|
| API | ApiErrorSchema, UCDWellKnownConfigSchema | Contracts for HTTP API responses and service discovery. |
| File System | FileEntrySchema, FileEntryListSchema, UCDStoreManifestSchema | Shapes for file entries and the top-level store manifest. |
| Lockfile & Snapshot | LockfileSchema, SnapshotSchema | State shapes used by the ucd CLI and the ucd-store app. |
| Version Manifest | ExpectedFileSchema, UCDStoreVersionManifestSchema | Per-version metadata served from /.well-known/ucd-store/{version}.json. |
| Unicode | UnicodeVersionSchema, UnicodeVersionDetailsSchema, UnicodeFileTreeNodeSchema, UnicodeFileTreeSchema | Shapes for Unicode version metadata and file-tree responses. |