Interface EnumSchema<S>

a schema that validates one of a set of strings

interface EnumSchema<S> {
    enum: S;
    metadata?: unknown;
    nullable?: boolean;
}

Type Parameters

  • S extends readonly [string, ...string[]] = readonly [string, ...string[]]

Properties

enum: S

an array of all values allowed

metadata?: unknown

optional metadata on a schema

nullable?: boolean

a key indicating if a type can be null