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

Hierarchy

  • Predicate<Set<any>>
    • SetPredicate

Implements

  • BasePredicate<Set<any>>

Index

Constructors

constructor

Accessors

empty

empty:

Test a Set to be empty.

nonEmpty

nonEmpty:

Test a Set to be not empty.

not

not:

Invert the following validators.

Methods

deepEqual

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

    Parameters

    • expected: Set<any>

      Expected Set to match.

    Returns this

has

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

    Parameters

    • Rest ...items: any[]

      The items that should be a item in the Set.

    Returns this

hasAny

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

    Parameters

    • Rest ...items: any[]

      The items that could be a item in the Set.

    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: Set<any>): boolean | string
        • Parameters

          • value: Set<any>

          Returns boolean | string

    Returns this

maxSize

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

    Parameters

    • size: number

      The maximum size of the Set.

    Returns this

minSize

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

    Parameters

    • size: number

      The minimum size of the Set.

    Returns this

ofType

  • ofType<T>(predicate: Predicate<T>): this
  • Test all the items in the Set to match the provided predicate.

    Type parameters

    • T

    Parameters

    • predicate: Predicate<T>

      The predicate that should be applied against every item in the Set.

    Returns this

size

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

    Parameters

    • size: number

      The size of the Set.

    Returns this