Number schema type.

Hierarchy (View Summary)

Constructors

  • SchemaType constructor.

    Parameters

    • name: string = ''
    • Optionaloptions: { default?: number | () => number; required?: boolean }

    Returns default

Properties

default: () => number
name: string = ''
options: { default?: number | () => number; required: boolean }
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$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

Methods

  • Casts a number.

    Parameters

    • value_: unknown
    • Optionaldata: unknown

    Returns number

  • Casts a number.

    Parameters

    • Optionalvalue_: unknown
    • Optionaldata: unknown

    Returns number

  • Compares data. This function is used when sorting.

    Parameters

    • a: unknown
    • b: unknown

    Returns number

  • Checks the equality of data.

    Parameters

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

    Returns boolean

  • Parses data. This function is used when restoring data from database files.

    Parameters

    • value: unknown

    Returns any

  • 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 value is equal to one of elements in query.

    Parameters

    • value: unknown
    • query: 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: number
    • query: unknown
    • Optionaldata: unknown

    Returns boolean

  • Checks whether value is not equal to any elements in query.

    Parameters

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

    Returns boolean

  • Subtracts value from a number.

    Parameters

    • value: number
    • update: number

    Returns number

  • Divides a number by a value.

    Parameters

    • value: number
    • update: number

    Returns number

  • Adds value to a number.

    Parameters

    • value: number
    • update: number

    Returns number

  • Updates a number if the value is greater than the current value.

    Parameters

    • value: number
    • update: number

    Returns number

  • Updates a number if the value is less than the current value.

    Parameters

    • value: number
    • update: number

    Returns number

  • Divides a number by a value and returns the remainder.

    Parameters

    • value: number
    • update: number

    Returns number

  • Multiplies value to a number.

    Parameters

    • value: number
    • update: number

    Returns number

  • 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

  • Unsets the value.

    Type Parameters

    • T

    Parameters

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

    Returns T

  • Validates a number.

    Parameters

    • Optionalvalue_: unknown
    • Optionaldata: unknown

    Returns number

  • Transforms value. This function is used when saving data to database files.

    Parameters

    • value: unknown
    • Optionaldata: unknown

    Returns any