ow
Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • Predicate<Map<any, any>>
    • MapPredicate

Implements

  • BasePredicate<Map<any, any>>

Index

Constructors

constructor

Accessors

empty

empty:

Test a Map to be empty.

nonEmpty

nonEmpty:

Test a Map to be not empty.

not

not:

Invert the following validators.

Methods

deepEqual

  • deepEqual(expected: Map<any, any>): this
  • Test a Map to be deeply equal to the provided Map.

    Parameters

    • expected: Map<any, any>

      Expected Map to match.

    Returns this

hasAnyKeys

  • hasAnyKeys(...keys: any[]): this
  • Test a Map to include any of the provided keys. The keys are tested by identity, not structure.

    Parameters

    • Rest ...keys: any[]

      The keys that could be a key in the Map.

    Returns this

hasAnyValues

  • hasAnyValues(...values: any[]): this
  • Test a Map to include any of the provided values. The values are tested by identity, not structure.

    Parameters

    • Rest ...values: any[]

      The values that could be a value in the Map.

    Returns this

hasKeys

  • hasKeys(...keys: any[]): this
  • Test a Map to include all the provided keys. The keys are tested by identity, not structure.

    Parameters

    • Rest ...keys: any[]

      The keys that should be a key in the Map.

    Returns this

hasValues

  • hasValues(...values: any[]): this
  • Test a Map to include all the provided values. The values are tested by identity, not structure.

    Parameters

    • Rest ...values: any[]

      The values that should be a value in the Map.

    Returns this

is

  • is(fn: function): this
  • Test if the value matches a custom validation function. The validation function should return true if the value passes the function. If the function either returns false or a string, the function fails and the string will be used as error message.

    Parameters

    • fn: function

      Validation function.

        • (value: Map<any, any>): boolean | string
        • Parameters

          • value: Map<any, any>

          Returns boolean | string

    Returns this

keysOfType

  • keysOfType<T>(predicate: Predicate<T>): this
  • Test all the keys in the Map to match the provided predicate.

    Type parameters

    • T

    Parameters

    • predicate: Predicate<T>

      The predicate that should be applied against every key in the Map.

    Returns this

maxSize

  • maxSize(size: number): this
  • Test an Map to have a maximum size.

    Parameters

    • size: number

      The maximum size of the Map.

    Returns this

minSize

  • minSize(size: number): this
  • Test an Map to have a minimum size.

    Parameters

    • size: number

      The minimum size of the Map.

    Returns this

size

  • size(size: number): this
  • Test a Map to have a specific size.

    Parameters

    • size: number

      The size of the Map.

    Returns this

valuesOfType

  • valuesOfType<T>(predicate: Predicate<T>): this
  • Test all the values in the Map to match the provided predicate.

    Type parameters

    • T

    Parameters

    • predicate: Predicate<T>

      The predicate that should be applied against every value in the Map.

    Returns this