Skip to content

object

object<F>(fields): Schema<Struct<Fields<F>>>

An object with these keys. Keys that aren’t listed are removed when parsing.

F extends Readonly<Record<string, AnySchema>>

F

Schema<Struct<Fields<F>>>

const Config = S.object({
name: S.string().min(1),
kills: S.number().int().min(1).default(10),
note: S.string().optional(),
});