# Interface ArgumentChecker<T>

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.

interface ArgumentChecker<T> {
isDefined(message?: string): ArgumentChecker<T>;
isInRange(min: number, max: number, message?: string): ArgumentChecker<T>;
isNotEmpty(message?: string): ArgumentChecker<T>;
isNotMissing(message?: string): ArgumentChecker<T>;
isNotNull(message?: string): ArgumentChecker<T>;
matches(pattern: string | RegExp, message?: string): ArgumentChecker<T>;
satisfies(predicate: ((value: T) => boolean), message?: string): ArgumentChecker<T>;
}

#### Type Parameters

- T

#####
Index

### Methods

isDefined
isInRange
isNotEmpty
isNotMissing
isNotNull
matches
satisfies

##
Methods

### isDefined

- isDefined(message?): ArgumentChecker<T>

- Ensures that the argument is defined.

  #### Parameters

  - `Optional` message: string

  #### Returns ArgumentChecker<T>

### isInRange

- isInRange(min, max, message?): ArgumentChecker<T>

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

  #### Parameters

  - min: number
  - max: number
  - `Optional` message: string

  #### Returns ArgumentChecker<T>

### isNotEmpty

- isNotEmpty(message?): ArgumentChecker<T>

- Ensures that the argument is not empty.

  #### Parameters

  - `Optional` message: string

  #### Returns ArgumentChecker<T>

### isNotMissing

- isNotMissing(message?): ArgumentChecker<T>

- Ensures that the argument is not null or undefined.

  #### Parameters

  - `Optional` message: string

  #### Returns ArgumentChecker<T>

### isNotNull

- isNotNull(message?): ArgumentChecker<T>

- Ensures that the argument is not null.

  #### Parameters

  - `Optional` message: string

  #### Returns ArgumentChecker<T>

### matches

- matches(pattern, message?): ArgumentChecker<T>

- Ensures that the argument matches the given regular expression.

  #### Parameters

  - pattern: string | RegExp
  - `Optional` message: string

  #### Returns ArgumentChecker<T>

### satisfies

- satisfies(predicate, message?): ArgumentChecker<T>

- Ensures that the value satisfies a predicate.

  #### Parameters

  - predicate: ((value: T) => boolean)
    - - (value): boolean

      - #### Parameters

        - value: T

        #### Returns boolean

  - `Optional` message: string

  #### Returns ArgumentChecker<T>