unknown
Accepts any value without checks, including undefined. Never fails.
Signature
ts
function unknown(): Schema<unknown>When to use
- A field with arbitrary data that is validated later or not at all (metadata, settings).
- To keep a field in
datawhen the object usesunknown: 'strip'.
Example
Arbitrary metadata
ts
const Event = object({
type: string(),
payload: unknown(),
});See also
- object — passthrough mode for all unknown keys