String overview

Added in v1.0.0


Table of contents


String

String

Represents string inputs / outputs

Signature

export declare const String: (params?: StringParams | undefined) => StringSchema

Added in v1.0.0

Transformations

StringSchema (class)

The StringSchema transformer class, use instead S.String function to create a StringSchema

Signature

export declare class StringSchema {
  constructor(private readonly params?: StringParams)
}

Added in v2.2.0

brand (property)

Brands this string schema with a certain brand

Signature

readonly brand: <Brand>() => Schema<Opaque<string, Brand>, Opaque<string, Brand>>

Added in v2.2.0

minLength (property)

Sets the minimum required length of the string

Signature

readonly minLength: (minLength: number) => StringSchema

Added in v2.2.0

maxLength (property)

Sets the maximum required length of the string

Signature

readonly maxLength: (maxLength: number) => StringSchema

Added in v2.2.0

errorName (property)

Overrides the ‘expected’ field in TranscodeError > TypeMismatch

Signature

readonly errorName: (errorName: string) => StringSchema

Added in v2.2.0