Skip to content

ArraySchema

  • Methods<Native.$Array<E>, ArraySchema<E>>

E extends Native.Top

readonly is: (input) => input is readonly E["Type"][]

unknown

input is readonly E["Type"][]

Methods.is


readonly parse: (input) => Effect<readonly E["Type"][], ParseError, E["DecodingServices"]>

Checks input and returns it typed, with defaults filled in and unknown object keys removed.

unknown

Effect<readonly E["Type"][], ParseError, E["DecodingServices"]>

const config = yield* Config.parse(JSON.parse(text));

Methods.parse


readonly schema: $Array

The Effect schema underneath, for use with effect/Schema.

Methods.schema

default(value): Field<withDecodingDefaultType<$Array<E>, never>>

Uses value when the input is undefined or an object leaves the key out.

readonly E["Type"][]

Field<withDecodingDefaultType<$Array<E>, never>>

Methods.default


max(length, message?): ArraySchema<E>

number

string

ArraySchema<E>


min(length, message?): ArraySchema<E>

number

string

ArraySchema<E>


nullable(): Schema<NullOr<$Array<E>>>

Schema<NullOr<$Array<E>>>

Methods.nullable


optional(): Field<optional<$Array<E>>>

Allows undefined, and lets an object leave the key out.

Field<optional<$Array<E>>>

Methods.optional


refine(predicate, message?): ArraySchema

(value) => boolean

string

ArraySchema

Methods.refine