Class: Helpers

Helpers

Contains helper methods usable across the application


new Helpers()

Source:

Methods


<static> between(min, max, val)

Value Between

Determines if value is in a given range

Parameters:
Name Type Description
min number

The minimum for the range

max number

The maximum for the range

val number

The value to test for between

Source:
Returns:

True if the value is within the given range,
otherwise False

Type
boolean

<static> getMilliseconds(numOfDigits)

Milliseconds All Time

The milliseconds since Jan, 1 1970

Parameters:
Name Type Default Description
numOfDigits number 0

Truncates the value from the end of the number

Source:
Returns:

The milliseconds since Jan, 1 1970 as truncated

Type
number

<static> getRandomDecimal(min, max, places)

Random Float

Generates a random float based on the min/max values

Parameters:
Name Type Default Description
min number 1

The minimum random value

max number 100

The maximum random value

places number 2

The maximum number of decimal places

Source:
Returns:

A float within the specified range

Type
number

<static> getRandomInteger(min, max)

Random Integer

Generates a random integer based on the min/max values

Parameters:
Name Type Default Description
min number 1

The minimum random value

max number 100

The maximum random value

Source:
Returns:

An integer within the specified range

Type
number

<static> outputError(error, logOnly)

Error Output

Outputs the provided Error object to the console

Parameters:
Name Type Default Description
error Error

The error to show in the console

logOnly boolean false

Determines if console will write to error or log

Source: