Class: Utils

Utils()

Set of utility functions.

Constructor

new Utils()

Source:

Methods

(static) copyFile(sourceDir, destDir) → {type}

CALLED FROM:

Parameters:
Name Type Description
sourceDir type

description

destDir type

description

Source:
Returns:

description

Type
type

(static) copyFiles(sourceDir, destDir) → {type}

CALLED FROM:

Parameters:
Name Type Description
sourceDir type

description

destDir type

description

Source:
Returns:

description

Type
type

(static) getDate() → {type}

Returns date in YYYYMMDD-HHmmss-SSS
Reference: https://stackoverflow.com/questions/42862729/convert-date-object-in-dd-mm-yyyy-hhmmss-format

Source:
Returns:

The formatted date.

Type
type

(static) isDirectory(pathToCheck) → {type}

isDirectory - description

Parameters:
Name Type Description
pathToCheck type

description

Source:
Returns:

description

Type
type

(static) isFunction(obj) → {boolean}

Is the given object a function?

Parameters:
Name Type Description
obj type

The object to check.

Source:
Returns:

true if the object is a function, false otherwise.

Type
boolean

(static) loadContext(session, id) → {type}

loadContext - loads an object based on an id.
TODO: Add check for participant

Parameters:
Name Type Description
session type

description

id type

description

Source:
Returns:

description

Type
type

(static) randomEl(array) → {type}

randomEl - description

Parameters:
Name Type Description
array type

description

Source:
Returns:

description

Type
type

(static) randomEls()

Random draws without replacement

Source:

(static) randomInt(low, high) → {number}

This function generates random integer between two numbers low (inclusive) and high (exclusive) ([low, high))

Reference: https://blog.tompawlak.org/generate-random-values-nodejs-javascript

Parameters:
Name Type Description
low type

the lower bound.

high type

the upper bound.

Source:
Returns:

A random number from [low, high).

Type
number

(static) readJSON(file) → {type}

Parameters:
Name Type Description
file type

description

Source:
Returns:

description

Type
type

(static) sum(items, prop) → {type}

sum - description

Parameters:
Name Type Description
items type

description

prop type

description

Source:
Returns:

description

Type
type