Options
All
  • Public
  • Public/Protected
  • All
Menu

String schema

Hierarchy

Index

Constructors

Properties

schema: StringRawSchema

Methods

  • provideTestError(object: any): Error
  • sanitize(object: any): any
  • test(object: any): boolean
  • Tests the schema against an object

    Parameters

    • object: any

      The object to test

    Returns boolean

    true if it matches the schema, false if it does not match

  • Sets default value, in case the object is null, undefined or cannot be parsed

    Parameters

    • defaultValue: string

      The default value

    Returns StringObjectSchema

    self

  • Sets max length for the string. If the string length is greater than this value, it will be truncated.

    Parameters

    • maxLength: number

      The max length for the string.

    Returns StringObjectSchema

    self

Generated using TypeDoc