Array schema type.

Type Parameters

Hierarchy (View Summary)

Constructors

  • Type Parameters

    Parameters

    • name: string
    • Optionaloptions: Partial<{ default?: I[] | () => I[]; required: boolean }> & { child?: T }
      • required
      • default
      • child
      • Optionalchild?: T

    Returns default<I, T>

Properties

child: T
default: () => I[]
name: string = ''
options: { default?: I[] | () => I[]; required: boolean } & { child?: T }
q$exists: (value: unknown, query: unknown, data?: unknown) => boolean

Type declaration

    • (value: unknown, query: unknown, data?: unknown): boolean
    • Checks the existance of data.

      Parameters

      • value: unknown
      • query: unknown
      • Optionaldata: unknown

      Returns boolean

q$length: (value?: unknown[], query?: unknown, data?: unknown) => boolean

Type declaration

    • (value?: unknown[], query?: unknown, data?: unknown): boolean
    • Checks whether the number of elements in an array is equal to query.

      Parameters

      • Optionalvalue: unknown[]
      • Optionalquery: unknown
      • Optionaldata: unknown

      Returns boolean

q$max: (value: unknown, query: unknown, data?: unknown) => boolean

Type declaration

    • (value: unknown, query: unknown, data?: unknown): boolean
    • Checks whether value is less than or equal to (i.e. <=) the query.

      Parameters

      • value: unknown
      • query: unknown
      • Optionaldata: unknown

      Returns boolean

q$min: (value: unknown, query: unknown, data?: unknown) => boolean

Type declaration

    • (value: unknown, query: unknown, data?: unknown): boolean
    • Checks whether value is greater than or equal to (i.e. >=) the query.

      Parameters

      • value: unknown
      • query: unknown
      • Optionaldata: unknown

      Returns boolean

u$append: <T>(value?: T[], update?: T | T[], data?: unknown) => T[]

Type declaration

    • <T>(value?: T[], update?: T | T[], data?: unknown): T[]
    • Add elements to an array.

      Type Parameters

      • T

      Parameters

      • Optionalvalue: T[]
      • Optionalupdate: T | T[]
      • Optionaldata: unknown

      Returns T[]

u$prepend: <T>(value?: T[], update?: T | T[], data?: unknown) => T[]

Type declaration

    • <T>(value?: T[], update?: T | T[], data?: unknown): T[]
    • Add elements in front of an array.

      Type Parameters

      • T

      Parameters

      • Optionalvalue: T[]
      • Optionalupdate: T | T[]
      • Optionaldata: unknown

      Returns T[]

Methods

  • Casts an array and its child elements.

    Parameters

    • value_: unknown
    • Optionaldata: unknown

    Returns I[]

  • Casts an array and its child elements.

    Parameters

    • Optionalvalue_: unknown
    • Optionaldata: unknown

    Returns I[]

  • Compares an array by its child elements and the size of the array.

    Parameters

    • Optionala: I[]
    • Optionalb: I[]

    Returns number

  • Checks the equality of an array.

    Parameters

    • Optionalvalue: I[]
    • Optionalquery: unknown[]
    • Optionaldata: unknown

    Returns boolean

  • Checks whether an array contains all elements in query.

    Type Parameters

    • T

    Parameters

    • Optionalvalue: T[]
    • Optionalquery: T[]
    • Optionaldata: unknown

    Returns boolean

  • Checks the existance of data.

    Parameters

    • value: unknown
    • query: unknown
    • Optionaldata: unknown

    Returns boolean

  • Checks whether value is greater than (i.e. >) the query.

    Parameters

    • value: unknown
    • query: unknown
    • Optionaldata: unknown

    Returns boolean

  • Checks whether value is greater than or equal to (i.e. >=) the query.

    Parameters

    • value: unknown
    • query: unknown
    • Optionaldata: unknown

    Returns boolean

  • Checks whether an array contains one of elements in query.

    Parameters

    • Optionalvalue: unknown[]
    • Optionalquery: unknown[]
    • Optionaldata: unknown

    Returns boolean

  • Checks whether value is less than (i.e. <) the query.

    Parameters

    • value: unknown
    • query: unknown
    • Optionaldata: unknown

    Returns boolean

  • Checks whether value is less than or equal to (i.e. <=) the query.

    Parameters

    • value: unknown
    • query: unknown
    • Optionaldata: unknown

    Returns boolean

  • Checks the equality of data. Returns true if the value doesn't match.

    Parameters

    • value: I[]
    • query: unknown
    • Optionaldata: unknown

    Returns boolean

  • Checks whether an array does not contain in any elements in query.

    Type Parameters

    • T

    Parameters

    • Optionalvalue: T[]
    • Optionalquery: T[]
    • Optionaldata: unknown

    Returns boolean

  • Checks whether the number of elements in an array is equal to query.

    Parameters

    • Optionalvalue: unknown[]
    • Optionalquery: unknown
    • Optionaldata: unknown

    Returns boolean

  • Add elements to an array only if the value is not already in the array.

    Type Parameters

    • T

    Parameters

    • Optionalvalue: T[]
    • Optionalupdate: T | T[]
    • Optionaldata: unknown

    Returns T[]

  • Removes the last element from an array.

    Type Parameters

    • T

    Parameters

    • Optionalvalue: T[]
    • Optionalupdate: number | boolean
    • Optionaldata: unknown

    Returns T[]

  • Removes elements from an array.

    Type Parameters

    • T

    Parameters

    • Optionalvalue: T[]
    • Optionalupdate: T | T[]
    • Optionaldata: unknown

    Returns T[]

  • Add elements to an array.

    Type Parameters

    • T

    Parameters

    • Optionalvalue: T[]
    • Optionalupdate: T | T[]
    • Optionaldata: unknown

    Returns T[]

  • Renames a field.

    Parameters

    • value: unknown
    • update: string
    • data: unknown

    Returns void

  • Sets the value.

    Type Parameters

    • T

    Parameters

    • value: unknown
    • update: T
    • Optionaldata: unknown

    Returns T

  • Removes the first element from an array.

    Type Parameters

    • T

    Parameters

    • Optionalvalue: T[]
    • Optionalupdate: number | boolean
    • Optionaldata: unknown

    Returns T[]

  • Unsets the value.

    Type Parameters

    • T

    Parameters

    • value: T
    • update: boolean
    • Optionaldata: unknown

    Returns T

  • Add elements in front of an array.

    Type Parameters

    • T

    Parameters

    • Optionalvalue: T[]
    • Optionalupdate: T | T[]
    • Optionaldata: unknown

    Returns T[]

  • Validates an array and its child elements.

    Parameters

    • Optionalvalue_: unknown
    • Optionaldata: unknown

    Returns I[]

  • Transforms data.

    Parameters

    • value: unknown[]
    • Optionaldata: unknown

    Returns any[]

  • Transforms data.

    Returns undefined