@lucid-softworks/schema-collections
v0.1.0
Published
Composable array, tuple, and string-keyed record schemas.
Maintainers
Readme
@lucid-softworks/schema-collections
Composable schemas for homogeneous arrays, fixed heterogeneous tuples, and string-keyed records. Nested failures retain their index or key paths.
import {
arraySchema,
recordSchema,
tupleSchema,
} from "@lucid-softworks/schema-collections";
import { numberSchema, stringSchema } from "@lucid-softworks/schema-primitives";
const points = arraySchema(tupleSchema([numberSchema(), numberSchema()]));
const scores = recordSchema(numberSchema({ minimum: 0 }));