Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • SintiumUtility

Index

Methods

Static assert

  • assert(value: any, message?: string): void
  • Assert

    throws

    Throws on false value

    Parameters

    • value: any
    • Default value message: string = "Assertion failed"

    Returns void

Static corsRequest

  • corsRequest(url: string, method: string, data: string, callback: Function, errback: Function, authToken: string): void
  • Make a X-Domain request to url and callback.

    Parameters

    • url: string
    • method: string

      HTTP verb ("GET", "POST", "DELETE", etc.)

    • data: string

      request body

    • callback: Function

      to callback on completion

    • errback: Function

      to callback on error

    • authToken: string

      the incoming authorization token

    Returns void

Static guidGenerator

  • guidGenerator(): string
  • Returns string

Static isArray

  • isArray(value: any): boolean
  • Parameters

    • value: any

    Returns boolean

Static modulo

  • modulo(a: number, b: number): number
  • The % operator in JavaScript returns the remainder of a / b, but differs from some other languages in that the result will have the same sign as the dividend. For example, -1 % 8 == -1, whereas in some other languages (such as Python) the result would be 7. This function emulates the more correct modulo behavior, which is useful for certain applications such as calculating an offset index in a circular list.

    link

    https://closure-library.googlecode.com/git-history/docs/local_closure_goog_math_math.js.source.html#line73

    Parameters

    • a: number

      The dividend.

    • b: number

      The divisor.

    Returns number

    a % b where the result is between 0 and b (either 0 <= x < b or b < x <= 0, depending on the sign of b).

Static nFormatter

  • nFormatter(num: number, digits?: number): string
  • Parameters

    • num: number
    • Default value digits: number = 0

    Returns string

Static zeroPad

  • zeroPad(num: string | number, places: number): string
  • Zero pad

    Parameters

    • num: string | number
    • places: number

    Returns string

Generated using TypeDoc