Overview
The@apisr/schema package provides type utilities that help you infer TypeScript types from Zod schemas, making your code type-safe and reducing duplication.
Type Utilities
Infer
Infers the output type of a schema.Example
InferOr
Infers the type from a schema, or falls back to a default type if the schema doesn’t resolve to a record.Example
InferUndefined
Infers the type from a schema that might be undefined, excluding the undefined case.Example
ExtractSchema
Extracts theschema property from an object type.