Options
All
  • Public
  • Public/Protected
  • All
Menu

A fluent interface for performing assertions on a method argument. When an assertion fails, an Error of type ArgumentError (or one of its subtypes) will be thrown.

Hierarchy

  • ArgumentChecker

Implemented by

Index

Methods

isDefined

  • Ensures that the argument is defined.

    Parameters

    • Optional message: string

    Returns ArgumentChecker

isInRange

  • Ensures that the argument falls within a certain range (inclusive).

    Parameters

    • min: number
    • max: number
    • Optional message: string

    Returns ArgumentChecker

isNotEmpty

  • Ensures that the argument is not empty.

    Parameters

    • Optional message: string

    Returns ArgumentChecker

isNotMissing

  • Ensures that the argument is not null or undefined.

    Parameters

    • Optional message: string

    Returns ArgumentChecker

isNotNull

  • Ensures that the argument is not null.

    Parameters

    • Optional message: string

    Returns ArgumentChecker

matches

  • Ensures that the argument matches the given regular expression.

    Parameters

    • pattern: string | RegExp
    • Optional message: string

    Returns ArgumentChecker

satisfies

  • Ensures that the value satisfies a predicate.

    Parameters

    • predicate: function
        • (value: any): boolean
        • Parameters

          • value: any

          Returns boolean

    • Optional message: string

    Returns ArgumentChecker