String schema type.

Hierarchy (View Summary)

Constructors

  • SchemaType constructor.

    Parameters

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

    Returns default

Properties

default: () => string
name: string = ''
options: { default?: string | () => string; 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 string.

    Parameters

    • value_: { toString(): string }
    • Optionaldata: unknown

    Returns string

  • Casts a string.

    Parameters

    • Optionalvalue_: unknown
    • Optionaldata: unknown

    Returns string

  • Compares data. This function is used when sorting.

    Parameters

    • a: unknown
    • b: unknown

    Returns number

  • Checks the equality of data.

    Parameters

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

    Parameters

    • value: string
    • query: string[] | RegExp[]
    • Optionaldata: unknown

    Returns boolean

  • Checks length of a string.

    Parameters

    • value: string
    • query: number

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

    Returns boolean

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

    Parameters

    • value: string
    • query: string[] | RegExp[]
    • Optionaldata: unknown

    Returns boolean

  • 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 string.

    Parameters

    • Optionalvalue_: unknown
    • Optionaldata: unknown

    Returns string

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

    Parameters

    • value: unknown
    • Optionaldata: unknown

    Returns any