object
object<
F>(fields):Schema<Struct<Fields<F>>>
An object with these keys. Keys that aren’t listed are removed when parsing.
Type Parameters
Section titled “Type Parameters”F extends Readonly<Record<string, AnySchema>>
Parameters
Section titled “Parameters”fields
Section titled “fields”F
Returns
Section titled “Returns”Schema<Struct<Fields<F>>>
Example
Section titled “Example”const Config = S.object({ name: S.string().min(1), kills: S.number().int().min(1).default(10), note: S.string().optional(),});