Options
All
  • Public
  • Public/Protected
  • All
Menu

Guard class for sanity-checking (null checking, check if property is true, check arrays same length etc...)

Hierarchy

  • Guard

Index

Methods

Static argumentIsRealInteger

  • argumentIsRealInteger(d: number, name: string): void
  • Asserts a numeric argument is a real number: not null (undefined), not NaN and not infinite

    Parameters

    • d: number
    • name: string

    Returns void

Static argumentIsRealNumber

  • argumentIsRealNumber(d: number, name: string): void
  • Asserts a numeric argument is a real number: not null (undefined), not NaN and not infinite

    Parameters

    • d: number
    • name: string

    Returns void

Static arraysSameLength

  • Asserts two arrays are not null (undefined) and are the same legnth

    throws

    Error - an error when the arrays are not the same length

    Parameters

    • arg: NumberArray | any[]

      The first array

    • name1: string

      The first array parameter name

    • arg2: NumberArray | any[]

      The second array

    • name2: string

      The second array parameter name

    Returns void

Static arraysSameLengthArr

  • arraysSameLengthArr(args?: TElement[]): void
  • Asserts multiple arrays are not null (undefined) and are the same legnth

    throws

    Error - an error when the arrays are not the same length

    Parameters

    • Default value args: TElement[] = []

      The array of arrays

    Returns void

Static isTrue

  • isTrue(value: boolean, message: string): void
  • Asserts a parameter is true

    throws

    Error - an error when the parameter is false

    Parameters

    • value: boolean
    • message: string

      The message to show if not true

    Returns void

Static notNull

  • notNull(arg: any, name: string): void
  • Asserts the argument is not null

    throws

    Error - an error when the argument is null or undefined

    Parameters

    • arg: any

      The argument

    • name: string

      The argument name

    Returns void

Generated using TypeDoc