Options
All
  • Public
  • Public/Protected
  • All
Menu

The class which contains commonly used functions by the library. These functions and variables exist in a class so they may be overridden if desired.

Hierarchy

  • Functions

Index

Properties

Static EPSILON

EPSILON: number = 0.00001

The maximum distance a number can be from another to be considered equivalent. This is to compensate for floating point precision issues.

Methods

Static abs

  • abs(x: number): number
  • Determines the absolute value of the given number.

    Parameters

    • x: number

      The number to return the positive version of.

    Returns number

    The absolute value of x.

Static appendTo

  • appendTo<T>(array: T[], input: T | T[]): T[]
  • Appends an element or array of elements to the end of the given array.

    Type parameters

    • T

    Parameters

    • array: T[]

      The array to append values to the end of.

    • input: T | T[]

      The element or array of elements to append to the end.

    Returns T[]

    The reference to the array given.

Static coalesce

  • coalesce(a: any, b: any): any
  • Returns the first argument which is defined.

    see

    Functions.isDefined

    Parameters

    • a: any

      The first argument to look at.

    • b: any

      The second argument to look at.

    Returns any

    The first defined argument.

Static gcd

  • gcd(a: number, b: number): number
  • Calculates the greatest common denominator between the two numbers. If either of the numbers are not whole (integers) then 1 is immediately returned.

    Parameters

    • a: number

      The first number.

    • b: number

      The second number.

    Returns number

    The greatest common denominator between the two numbers.

Static isArray

  • isArray(input: any): boolean
  • Determines whether the given input is an array.

    Parameters

    • input: any

      The variable to test.

    Returns boolean

    True if the variable is an array, otherwise false.

Static isDefined

  • isDefined(input: any): boolean
  • Determines whether the given input is defined.

    Parameters

    • input: any

      The variable to test.

    Returns boolean

    True if the variable is defined, otherwise false.

Static isEqual

  • isEqual(a: number, b: number): boolean
  • Determines if the given number is equal to another.

    see

    Functions.EPSILON

    Parameters

    • a: number

      The first number to compare.

    • b: number

      The second number to compare.

    Returns boolean

    True if the two numbers are equal.

Static isGroupDefinition

  • isGroupDefinition(input: any): boolean

Static isNumber

  • isNumber(x: any): boolean
  • Determines if the given number is valid. A valid number is finite and not NaN or Infinity.

    Parameters

    • x: any

      The number to test.

    Returns boolean

    True if the input is finite number.

Static isRangeDefinition

  • isRangeDefinition(input: any): boolean

Static isSingular

  • isSingular(x: any): boolean
  • Determines if the given number is singular. A singular number is 1 or -1.

    see

    Functions.EPSILON

    Parameters

    • x: any

      The number to test.

    Returns boolean

    True if the number is singular, otherwise false.

Static isString

  • isString(input: any): boolean
  • Determines whether the given input is a string.

    Parameters

    • input: any

      The variable to test.

    Returns boolean

    True if the variable is a string, otherwise false.

Static isValueDefinition

  • isValueDefinition(input: any): boolean

Static isWhole

  • isWhole(x: number): boolean
  • Determines if the given number is a whole number (integer).

    see

    Functions.EPSILON

    Parameters

    • x: number

      The number to test.

    Returns boolean

    True if the number is whole, otherwise false.

Static isZero

  • isZero(x: number): boolean
  • Determines if the given number is zero.

    see

    Functions.EPSILON

    Parameters

    • x: number

      The number to test.

    Returns boolean

    True if the number is zero, otherwise false.

Static sign

  • sign(x: number): number
  • Determines the sign of the given number. One of three values will be returned: 1, 0, or -1.

    Parameters

    • x: number

      The number to determine the sign of.

    Returns number

    The sign of the given number.

Static trim

  • trim(x: string): string
  • Trims the given input if its a string.

    Parameters

    • x: string

      The string to remove space from the beginning and end.

    Returns string

    A trimmed string.

Legend

  • Module
  • Object literal
  • Variable
  • Function
  • Function with type parameter
  • Index signature
  • Type alias
  • Enumeration
  • Enumeration member
  • Property
  • Method
  • Interface
  • Interface with type parameter
  • Constructor
  • Property
  • Method
  • Index signature
  • Class
  • Class with type parameter
  • Constructor
  • Property
  • Method
  • Accessor
  • Index signature
  • Inherited constructor
  • Inherited property
  • Inherited method
  • Inherited accessor
  • Protected property
  • Protected method
  • Protected accessor
  • Private property
  • Private method
  • Private accessor
  • Static property
  • Static method

Generated using TypeDoc