Options
All
  • Public
  • Public/Protected
  • All
Menu

Schema for Array

Hierarchy

Index

Constructors

Properties

schema: ArrayRawSchema

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: any[]

      The default value

    Returns ArrayObjectSchema

    self

  • Sets the ID for this schema to be referenced by its children for recursion

    Parameters

    • id: string

      The identifier of the schema node

    Returns ArrayObjectSchema

    self

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

    Parameters

    • maxLength: number

      The max length for the array.

    Returns ArrayObjectSchema

    self

Generated using TypeDoc