Options
All
  • Public
  • Public/Protected
  • All
Menu

Object schema

Hierarchy

Index

Constructors

Properties

schema: ObjectRawSchema

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 the ID for this schema to be referenced by its children for recursion

    Parameters

    • id: string

      The identifier of the schema node

    Returns ObjectSchema

    self

  • withPropertyFilter(extraPropsFilter: (key: string) => boolean, extraPropsSchema: (key: string) => ObjectSchemaI): ObjectSchema
  • Sets property filter for dynamic dictionaries

    Parameters

    • extraPropsFilter: (key: string) => boolean

      Function to filter the the propeties

        • (key: string): boolean
        • Parameters

          • key: string

          Returns boolean

    • extraPropsSchema: (key: string) => ObjectSchemaI

      Function to determine the schema to use in each case

    Returns ObjectSchema

    self

  • Schema for dictionary (key => value)

    Parameters

    • propsFilter: (key: string) => boolean

      Property filter

        • (key: string): boolean
        • Parameters

          • key: string

          Returns boolean

    • propsSchema: (key: string) => ObjectSchemaI

      Function to determine schema for properties

    Returns ObjectSchema

    a new schema instance

  • Schema from raw representation

    Parameters

    • raw: ObjectRawSchema

      Raw schema representation

    Returns ObjectSchemaI

    a new schema instance

Generated using TypeDoc