Initial CultCacheTS port

This commit is contained in:
Meta Vens 2026-05-06 03:11:02 +01:00
commit 0c430c3c0e
10 changed files with 544 additions and 0 deletions

13
src/document.ts Normal file
View file

@ -0,0 +1,13 @@
import type { ZodType } from "zod";
import type { CultCacheDocumentDefinition } from "./types";
export function defineDocumentType<TSchema extends ZodType>(
definition: CultCacheDocumentDefinition<TSchema>,
): CultCacheDocumentDefinition<TSchema> {
if (!definition.type || definition.type.trim().length === 0) {
throw new Error("CultCache document types must declare a non-empty type.");
}
return definition;
}