Skip to main content

string

Creates a schema that matches strings.

const stringSchema = string();
const stringValidator = validate(stringSchema);

// Returns 'Michael'
const michael = stringValidator('Michael');