# Class: GenUtils

## GenUtils()

Collection of general purpose utilities. TODO: could pull in assert and remove these asserts TODO: needs cleanup as ES6+ utility class

## Constructor

#### new GenUtils()

Source:
  - src/main/js/common/GenUtils.js, line 32

### Methods

#### (static) arrToCsv(arr)

Converts the given array to a CSV string.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arr` |  | is a 2-dimensional array of strings

Source:
  - src/main/js/common/GenUtils.js, line 816

##### Returns:

the CSV string

#### (static) arrayContains(arr, obj, compareByReference)

Indicates if the given array contains the given object.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arr` | Array.<object> | array that may or may not contain the object
`obj` | object | object to check for inclusion in the array
`compareByReference` | boolean | compare strictly by reference, forgoing deep equality check

Source:
  - src/main/js/common/GenUtils.js, line 601

##### Returns:

true if the array contains the object, false otherwise

#### (static) arraysEqual(arr1, arr2)

Determines if two arrays are equal.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arr1` |  | is an array to compare
`arr2` |  | is an array to compare

Source:
  - src/main/js/common/GenUtils.js, line 628

##### Returns:

true if the arrays are equal, false otherwise

#### (static) assertArray(arg, msg)

Asserts that the given argument is an array.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to assert as an array
`msg` |  | is the message to throw if the argument is not an array

Source:
  - src/main/js/common/GenUtils.js, line 405

#### (static) assertBase58(arg, msg)

Asserts that the given argument is base58.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to assert as base58
`msg` |  | is the message to throw if the argument is not base58

Source:
  - src/main/js/common/GenUtils.js, line 208

#### (static) assertBase64(arg, msg)

Asserts that the given argument is base64.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to assert as base64
`msg` |  | is the message to throw if the argument is not base64

Source:
  - src/main/js/common/GenUtils.js, line 227

#### (static) assertBoolean(arg, msg)

Asserts that the given argument is a boolean.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to assert as a boolean
`msg` |  | is the message to throw if the argument is not a boolean

Source:
  - src/main/js/common/GenUtils.js, line 385

#### (static) assertDefined(arg, msg)

Asserts that the given argument is defined. Throws an exception if undefined.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to assert defined
`msg` |  | is the message to throw if arg is undefined (optional)

Source:
  - src/main/js/common/GenUtils.js, line 301

#### (static) assertEquals(arg1, arg2, msg)

Asserts that the given arguments are equal. Throws an exception if not equal.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg1` |  | is an argument to assert as equal
`arg2` |  | is an argument to assert as equal
`msg` |  | is the message to throw if the arguments are not equal

Source:
  - src/main/js/common/GenUtils.js, line 344

#### (static) assertFalse(bool, msg)

Asserts that the given boolean is false. Throws an exception if not a boolean or true.

##### Parameters:

Name | Type | Description
--- | --- | ---
`bool` |  | is the boolean to assert false
`msg` |  | is the message to throw if bool is true (optional)

Source:
  - src/main/js/common/GenUtils.js, line 270

#### (static) assertFunction(arg, msg)

Asserts that the given argument is a static.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to assert as a static
`msg` |  | is the message to throw if the argument is not a static

Source:
  - src/main/js/common/GenUtils.js, line 415

#### (static) assertHex(arg, msg)

Asserts that the given argument is hex.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to assert as hex
`msg` |  | is the message to throw if the argument is not hex

Source:
  - src/main/js/common/GenUtils.js, line 175

#### (static) assertInitialized(arg, msg)

Asserts that the given argument is initialized. Throws an exception if not initialized.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to assert as initialized
`msg` |  | is the message to throw if arg is not initialized (optional)

Source:
  - src/main/js/common/GenUtils.js, line 321

#### (static) assertInt(arg, msg)

Asserts that the given argument is an integer.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to assert as an integer
`msg` |  | is the message to throw if the argument is not an integer

Source:
  - src/main/js/common/GenUtils.js, line 365

#### (static) assertNotEquals(arg1, arg2, msg)

Asserts that the given arguments are not equal. Throws an exception if equal.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg1` |  | is an argument to assert as not equal
`arg2` |  | is an argument to assert as not equal
`msg` |  | is the message to throw if the arguments are equal

Source:
  - src/main/js/common/GenUtils.js, line 355

#### (static) assertNotNull(arg, msg)

Asserts that the given argument is not null. Throws an exception if null.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to assert not null
`msg` |  | is the message to throw if arg is null (optional)

Source:
  - src/main/js/common/GenUtils.js, line 291

#### (static) assertNull(arg, msg)

Asserts that the given argument is null. Throws an exception if not null.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to assert null
`msg` |  | is the message to throw if arg is not null (optional)

Source:
  - src/main/js/common/GenUtils.js, line 281

#### (static) assertNumber(arg, msg)

Asserts that the given argument is a number.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to assert as a number
`msg` |  | is the message to throw if the argument is not a number

Source:
  - src/main/js/common/GenUtils.js, line 375

#### (static) assertObject(arg, obj, msg)

Asserts that the given argument is an object with the given name.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to test
`obj` |  | is an object to assert arg instanceof obj (optional)
`msg` |  | is the message to throw if the argument is not the specified object

Source:
  - src/main/js/common/GenUtils.js, line 426

#### (static) assertString(arg, msg)

Asserts that the given argument is a string.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to assert as a string
`msg` |  | is the message to throw if the argument is not a string

Source:
  - src/main/js/common/GenUtils.js, line 395

#### (static) assertTrue(bool, msg)

Asserts that the given boolean is true. Throws an exception if not a boolean or false.

##### Parameters:

Name | Type | Description
--- | --- | ---
`bool` |  | is the boolean to assert true
`msg` |  | is the message to throw if bool is false (optional)

Source:
  - src/main/js/common/GenUtils.js, line 259

#### (static) assertUndefined(arg, msg)

Asserts that the given argument is undefined. Throws an exception if defined.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to assert undefined
`msg` |  | is the message to throw if arg is defined (optional)

Source:
  - src/main/js/common/GenUtils.js, line 311

#### (static) assertUninitialized(arg, msg)

Asserts that the given argument is uninitialized. Throws an exception if initialized.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to assert as uninitialized
`msg` |  | is the message to throw if arg is initialized (optional)

Source:
  - src/main/js/common/GenUtils.js, line 333

#### (static) buildHtmlDocument(content)

Manually builds an HTML document string.

##### Parameters:

Name | Type | Description
--- | --- | ---
`content` |  | specifies optional document content content.div is a pre-existing div to stringify and add to the body content.title is the title of the new tab content.dependencyPaths specifies paths to js, css, or img paths content.internalCss is css to embed in the html document content.metas are meta elements with keys/values to include

Source:
  - src/main/js/common/GenUtils.js, line 923

##### Returns:

str is the document string

#### (static) copyArray(arr)

Copies the given array.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arr` |  | is the array to copy

Source:
  - src/main/js/common/GenUtils.js, line 543

##### Returns:

a copy of the given array

#### (static) copyProperties(obj)

Copies properties in the given object to a new object.

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` |  | is object to copy properties for

Source:
  - src/main/js/common/GenUtils.js, line 785

##### Returns:

a new object with properties copied from the given object

#### (static) countNonWhitespaceCharacters(str)

Counts the number of non-whitespace characters in the given string.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` |  | is the string to count the number of non-whitespace characters in

Source:
  - src/main/js/common/GenUtils.js, line 856

##### Returns:

int is the number of non-whitespace characters in the given string

#### (static) csvToArr(csv)

Converts a CSV string to a 2-dimensional array of strings.

##### Parameters:

Name | Type | Description
--- | --- | ---
`csv` |  | is the CSV string to convert

Source:
  - src/main/js/common/GenUtils.js, line 806

##### Returns:

a 2-dimensional array of strings

#### (static) deleteProperties(obj)

Deletes all properties in the given object.

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` |  | is the object to delete properties from

Source:
  - src/main/js/common/GenUtils.js, line 794

#### (static) deleteUndefinedKeys(obj)

Deletes properties from the object that are undefined.

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` |  | is the object to delete undefined keys from

Source:
  - src/main/js/common/GenUtils.js, line 711

#### (static) equals(arg1, arg2)

Determines if two arguments are deep equal.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg1` |  | is an argument to compare
`arg2` |  | is an argument to compare

Source:
  - src/main/js/common/GenUtils.js, line 650

##### Returns:

true if the arguments are deep equals, false otherwise

#### (static) fail(msg)

Throws an exception with the given message.

##### Parameters:

Name | Type | Description
--- | --- | ---
`msg` |  | defines the message to throw the exception with (optional)

Source:
  - src/main/js/common/GenUtils.js, line 249

#### (static) getCombinations(arr, combinationSize)

Returns combinations of the given array of the given size.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arr` |  | is the array to get combinations from
`combinationSize` |  | specifies the size of each combination

Source:
  - src/main/js/common/GenUtils.js, line 723

#### (static) getDownloadableA(name, contents)

Gets an 'a' element that is downloadable when clicked.

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` |  | is the name of the file to download
`contents` |  | are the string contents of the file to download

Source:
  - src/main/js/common/GenUtils.js, line 760

##### Returns:

'a' dom element with downloadable file

#### (static) getIEVersion()

Gets the IE version number. Credit: https://stackoverflow.com/questions/19999388/check-if-user-is-using-ie-with-jquery/21712356#21712356

Source:
  - src/main/js/common/GenUtils.js, line 1258

##### Returns:

the IE version number or null if not IE

#### (static) getImages(paths, onDone(err,)

Fetches the given list of images. Prerequisite: async.js.

##### Parameters:

Name | Type | Description
--- | --- | ---
`paths` |  | are the paths to the images to fetch
`onDone(err,` |  | images) is called when done

Source:
  - src/main/js/common/GenUtils.js, line 1099

#### (static) getIndent(length) → {string}

Returns a string indentation of the given length;

##### Parameters:

Name | Type | Description
--- | --- | ---
`length` |  | is the length of the indentation

Source:
  - src/main/js/common/GenUtils.js, line 1133

##### Returns:

is an indentation string of the given length

Type
  string

#### (static) getIndices(size)

Returns an array of indices of the given size.

##### Parameters:

Name | Type | Description
--- | --- | ---
`size` |  | specifies the size to get indices for

Source:
  - src/main/js/common/GenUtils.js, line 517

##### Returns:

array of the given size with indices starting at 0

#### (static) getInternalStyleSheet()

Returns the document's first stylesheet which has no href.

Source:
  - src/main/js/common/GenUtils.js, line 889

##### Returns:

StyleSheet is the internal stylesheet

#### (static) getInternalStyleSheetText()

Returns the document's internal stylesheet as text.

Source:
  - src/main/js/common/GenUtils.js, line 902

##### Returns:

str is the document's internal stylesheet

#### (static) getLines(str, string[)

Returns lines separated by newlines from the given string.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` |  | is the string to get lines from
`string[` |  | are the lines separated by newlines within the string

Source:
  - src/main/js/common/GenUtils.js, line 880

#### (static) getOuterHtml(node)

Returns the given node's outer HTML.

##### Parameters:

Name | Type | Description
--- | --- | ---
`node` |  | is the node to get outer HTML for

Source:
  - src/main/js/common/GenUtils.js, line 775

##### Returns:

the outer HTML of the given node

#### (static) getParameterByName(name, url)

Gets a parameter value. Credit: https://stackoverflow.com/questions/901115/how-can-i-get-query-string-values-in-javascript

##### Parameters:

Name | Type | Description
--- | --- | ---
`name` |  | is the name of the parameter to get the value of
`url` |  | is a URL to get the parameter from, uses the window's current href if not given

Source:
  - src/main/js/common/GenUtils.js, line 1293

##### Returns:

the parameter's value

#### (static) getPowerSet(arr)

Returns the power set of the given array.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arr` |  | is the array to get the power set of

Source:
  - src/main/js/common/GenUtils.js, line 468

##### Returns:

[][] is the power set of the given array

#### (static) getPowerSetOfLength(arr, size)

Returns the power set of the given array whose elements are the given size.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arr` |  | is the array to get the power set of
`size` |  | is the required size of the elements within the power set returns [][] is the power set of the given array whose elements are the given size

Source:
  - src/main/js/common/GenUtils.js, line 497

#### (static) getRandomInt(min, max)

Gets a non-cryptographically secure random number within a given range.

##### Parameters:

Name | Type | Description
--- | --- | ---
`min` |  | is the minimum range of the int to generate, inclusive
`max` |  | is the maximum range of the int to generate, inclusive Source: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Math/random

Source:
  - src/main/js/common/GenUtils.js, line 1310

#### (static) getRandomInts(min, max, count)

Gets random ints.

##### Parameters:

Name | Type | Description
--- | --- | ---
`min` |  | is the minimum range of the ints to generate, inclusive
`max` |  | is the maximum range of the ints to generate, inclusive
`count` |  | is the number of random ints to get

Source:
  - src/main/js/common/GenUtils.js, line 1323

#### (static) getUUID()

Generates a v4 UUID. Source: https://stackoverflow.com/questions/105034/create-guid-uuid-in-javascript

Source:
  - src/main/js/common/GenUtils.js, line 1223

#### (static) getUniqueRandomInts(min, max, count)

Gets a given number of unique random ints within a range.

##### Parameters:

Name | Type | Description
--- | --- | ---
`min` |  | is the minimum range of the ints to generate, inclusive
`max` |  | is the maximum range of the ints to generate, inclusive
`count` |  | is the number of unique random ints to get

Source:
  - src/main/js/common/GenUtils.js, line 1337

#### (static) getWhitespaceTokens(str)

Returns tokens separated by whitespace from the given string.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` |  | is the string to get tokens from

Source:
  - src/main/js/common/GenUtils.js, line 870

##### Returns:

string[] are the tokens separated by whitespace within the string

#### (static) hasWhitespace(str)

Indicates if the given string contains whitespace.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` |  | is the string to test

Source:
  - src/main/js/common/GenUtils.js, line 826

##### Returns:

true if the string contains whitespace, false otherwise

#### (static) imgToDataUrl(img, quality)

Converts the given image to a base64 encoded data url.

##### Parameters:

Name | Type | Description
--- | --- | ---
`img` |  | is the image to convert
`quality` |  | is a number between 0 and 1 specifying the image quality

Source:
  - src/main/js/common/GenUtils.js, line 1002

#### (static) inheritsFrom(child, parent)

Sets the child's prototype to the parent's prototype.

##### Parameters:

Name | Type | Description
--- | --- | ---
`child` |  | is the child class
`parent` |  | is the parent class

Source:
  - src/main/js/common/GenUtils.js, line 441

#### (static) initPolyfills()

Source:
  - src/main/js/common/GenUtils.js, line 1139

#### (static) invoke()

Invokes functions with arguments. arguments[0] is assumed to be an array of functions to invoke arguments[1...n] are args to invoke the functions with

Source:
  - src/main/js/common/GenUtils.js, line 452

#### (static) isArray(arg)

Indicates if the given argument is an array.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to test as being an array

Source:
  - src/main/js/common/GenUtils.js, line 101

##### Returns:

true if the argument is an array, false otherwise

#### (static) isBase32()

Determines if the given string is base32.

Source:
  - src/main/js/common/GenUtils.js, line 196

#### (static) isBase58()

Determines if the given string is base58.

Source:
  - src/main/js/common/GenUtils.js, line 215

#### (static) isBase64()

Determines if the given string is base64.

Source:
  - src/main/js/common/GenUtils.js, line 234

#### (static) isBoolean(arg)

Determines if the given argument is a boolean.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to test as being a boolean

Source:
  - src/main/js/common/GenUtils.js, line 121

##### Returns:

true if the argument is a boolean, false otherwise

#### (static) isBrowser() → {boolean}

Indicates if the current environment is a browser.

Source:
  - src/main/js/common/GenUtils.js, line 1235

##### Returns:

true if the environment is a browser, false otherwise

Type
  boolean

#### (static) isCsvFile(file)

Determines if the given file is a csv file.

##### Parameters:

Name | Type | Description
--- | --- | ---
`file` |  | is a file

Source:
  - src/main/js/common/GenUtils.js, line 1077

##### Returns:

true if the given file is a csv file, false otherwise

#### (static) isDefined(arg)

Indicates if the given argument is defined.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the arg to test

Source:
  - src/main/js/common/GenUtils.js, line 40

##### Returns:

true if the given arg is defined, false otherwise

#### (static) isFirefox() → {boolean}

Indicates if the current environment is a firefox-based browser.

Source:
  - src/main/js/common/GenUtils.js, line 1247

##### Returns:

true if the environment is a firefox-based browser, false otherwise

Type
  boolean

#### (static) isFunction(arg)

Determines if the given argument is a static.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to test as being a static

Source:
  - src/main/js/common/GenUtils.js, line 131

##### Returns:

true if the argument is a static, false otherwise

#### (static) isHex(str)

Indicates if the given argument is a hexidemal string. Credit: https://github.com/roryrjb/is-hex/blob/master/is-hex.js.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` |  | is the string to test

Source:
  - src/main/js/common/GenUtils.js, line 187

##### Returns:

true if the given string is hexidecimal, false otherwise

#### (static) isImageAccessible(url, timeout, onDone(bool))

Determines if the image at the given URL is accessible.

##### Parameters:

Name | Type | Description
--- | --- | ---
`url` |  | is the url to an image
`timeout` |  | is the maximum time to wait
`onDone(bool)` |  | when the image is determined to be accessible or not

Source:
  - src/main/js/common/GenUtils.js, line 1018

#### (static) isInitialized(arg)

Indicates if the given arg is initialized.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the arg to test

Source:
  - src/main/js/common/GenUtils.js, line 60

##### Returns:

true if the given arg is initialized, false otherwise

#### (static) isInt(arg)

Indicates if the given argument is an integer.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to test

Source:
  - src/main/js/common/GenUtils.js, line 91

##### Returns:

true if the given argument is an integer, false otherwise

#### (static) isJsonFile(file)

Determines if the given file is a json file.

##### Parameters:

Name | Type | Description
--- | --- | ---
`file` |  | is a file

Source:
  - src/main/js/common/GenUtils.js, line 1067

##### Returns:

true if the given file is a json file, false otherwise

#### (static) isLowerCase(str, true)

Determines if all alphabet characters in the given string are lower case.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` |  | is the string to test
`true` |  | if the string is lower case, false otherwise

Source:
  - src/main/js/common/GenUtils.js, line 165

#### (static) isNewline(char)

Indicates if the given character is a newline.

##### Parameters:

Name | Type | Description
--- | --- | ---
`char` |  | is the character to test

Source:
  - src/main/js/common/GenUtils.js, line 846

##### Returns:

true if the given character is a newline, false otherwise

#### (static) isNumber(arg)

Indicates if the given argument is a number.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to test

Source:
  - src/main/js/common/GenUtils.js, line 81

##### Returns:

true if the argument is a number, false otherwise

#### (static) isObject(arg, obj)

Indicates if the given argument is an object and optionally if it has the given constructor name.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to test
`obj` |  | is an object to test arg instanceof obj (optional)

Source:
  - src/main/js/common/GenUtils.js, line 142

##### Returns:

true if the given argument is an object and optionally has the given constructor name

#### (static) isString(arg)

Indicates if the given argument is a string.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the argument to test as being a string

Source:
  - src/main/js/common/GenUtils.js, line 111

##### Returns:

true if the argument is a string, false otherwise

#### (static) isTxtFile(file)

Determines if the given file is a txt file.

##### Parameters:

Name | Type | Description
--- | --- | ---
`file` |  | is a file

Source:
  - src/main/js/common/GenUtils.js, line 1087

##### Returns:

true if the given file is a txt file, false otherwise

#### (static) isUndefined(arg)

Indicates if the given argument is undefined.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the arg to test

Source:
  - src/main/js/common/GenUtils.js, line 50

##### Returns:

true if the given arg is undefined, false otherwise

#### (static) isUninitialized(arg)

Indicates if the given arg is uninitialized.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arg` |  | is the arg to test

Source:
  - src/main/js/common/GenUtils.js, line 70

##### Returns:

true if the given arg is uninitialized, false otherwise

#### (static) isUpperCase(str)

Determines if all alphabet characters in the given string are upper case.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` |  | is the string to test

Source:
  - src/main/js/common/GenUtils.js, line 155

##### Returns:

true if the string is upper case, false otherwise

#### (static) isWhitespace(char)

Indicates if the given character is whitespace.

##### Parameters:

Name | Type | Description
--- | --- | ---
`char` |  | is the character to test

Source:
  - src/main/js/common/GenUtils.js, line 836

##### Returns:

true if the given character is whitespace, false otherwise

#### (static) isZipFile(file)

Determines if the given file is a zip file.

##### Parameters:

Name | Type | Description
--- | --- | ---
`file` |  | is a file

Source:
  - src/main/js/common/GenUtils.js, line 1057

##### Returns:

true if the given file is a zip file, false otherwise

#### (async, static) killProcess(process, signal) → {Promise.<(number|undefined)>}

Kill the given nodejs child process.

##### Parameters:

Name | Type | Description
--- | --- | ---
`process` | process | the nodejs child process to kill
`signal` | string | undefined | the kill signal, e.g. SIGTERM, SIGKILL, SIGINT (default)

Source:
  - src/main/js/common/GenUtils.js, line 1502

##### Returns:

the exit code from killing the process

Type
  Promise.<(number|undefined)>

#### (static) kvLine(key, value, indent, newline, ignoreUndefined) → {string}

Returns a human-friendly key value line.

##### Parameters:

Name | Type | Default | Description
--- | --- | --- | ---
`key` |  |  | is the key
`value` |  |  | is the value
`indent` |  | 0 | indents the line
`newline` |  | true | specifies if the string should be terminated with a newline or not
`ignoreUndefined` |  | true | specifies if undefined values should return an empty string

Source:
  - src/main/js/common/GenUtils.js, line 1460

##### Returns:

is the human-friendly key value line

Type
  string

#### (static) listify(arrOrElem)

Listifies the given argument.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arrOrElem` |  | is an array or an element in the array

Source:
  - src/main/js/common/GenUtils.js, line 589

##### Returns:

an array which is the given arg if it's an array or an array with the given arg as an element

#### (static) newWindow(content, onLoad(err,)

Opens the given div in a new window.

##### Parameters:

Name | Type | Description
--- | --- | ---
`content` |  | specifies optional window content content.div is a pre-existing div to stringify and add to the body content.title is the title of the new tab content.dependencyPaths specifies paths to js, css, or img paths content.internalCss is css to embed in the html document content.metas are meta elements with keys/values to include
`onLoad(err,` |  | window) is invoked with a reference to the window when available

Source:
  - src/main/js/common/GenUtils.js, line 974

#### (static) objectsEqual(map1, map2)

Determines if two objects are deep equal. Undefined values are considered equal to non-existent keys.

##### Parameters:

Name | Type | Description
--- | --- | ---
`map1` |  | is a map to compare
`map2` |  | is a map to compare

Source:
  - src/main/js/common/GenUtils.js, line 665

##### Returns:

true if the maps have identical keys and values, false otherwise

#### (static) printStackTrace(msg)

Print the current stack trace.

##### Parameters:

Name | Type | Description
--- | --- | ---
`msg` | string | optional message to print with the trace

Source:
  - src/main/js/common/GenUtils.js, line 1481

#### (static) reconcile(val1, val2, config, errMsg)

Reconciles two values. TODO: remove custom error message

##### Parameters:

Name | Type | Description
--- | --- | ---
`val1` |  | is a value to reconcile
`val2` |  | is a value to reconcile
`config` |  | specifies reconciliation configuration config.resolveDefined uses defined value if true or undefined, undefined if false config.resolveTrue uses true over false if true, false over true if false, must be equal if undefined config.resolveMax uses max over min if true, min over max if false, must be equal if undefined
`errMsg` |  | is the error message to throw if the values cannot be reconciled (optional)

Source:
  - src/main/js/common/GenUtils.js, line 1406

##### Returns:

the reconciled value if reconcilable, throws error otherwise

#### (static) remove(arr, val)

Removes every instance of the given value from the given array.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arr` |  | is the array to remove the value from
`val` |  | is the value to remove from the array

Source:
  - src/main/js/common/GenUtils.js, line 557

##### Returns:

true if the value is found and removed, false otherwise

#### (static) safeSet(obj, getFn, setFn, val, config, errMsg)

Sets the given value ensuring a previous value is not overwritten. TODO: remove for portability because function passing not supported in other languages, use reconcile only

##### Parameters:

Name | Type | Description
--- | --- | ---
`obj` |  | is the object to invoke the getter and setter on
`getFn` |  | gets the current value
`setFn` |  | sets the current value
`val` |  | is the value to set iff it does not overwrite a previous value
`config` |  | specifies reconciliation configuration config.resolveDefined uses defined value if true or undefined, undefined if false config.resolveTrue uses true over false if true, false over true if false, must be equal if undefined config.resolveMax uses max over min if true, min over max if false, must be equal if undefined
`errMsg` |  | is the error message to throw if the values cannot be reconciled (optional)

Source:
  - src/main/js/common/GenUtils.js, line 1386

#### (static) shuffle()

Randomize array element order in-place using Durstenfeld shuffle algorithm. Credit: https://stackoverflow.com/questions/2450954/how-to-randomize-shuffle-a-javascript-array

Source:
  - src/main/js/common/GenUtils.js, line 1353

#### (static) sort(the)

Sorts an array by natural ordering.

##### Parameters:

Name | Type | Description
--- | --- | ---
`the` |  | array to sort

Source:
  - src/main/js/common/GenUtils.js, line 1367

#### (static) strContains(str, substring)

Indicates if the given string contains the given substring.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` |  | is the string to search for a substring
`substring` |  | is the substring to searchin within the string

Source:
  - src/main/js/common/GenUtils.js, line 617

##### Returns:

true if the substring is within the string, false otherwise

#### (static) stringifyBIs(str) → {string}

Replace big integers (16 or more consecutive digits) with strings in order to preserve numeric precision.

##### Parameters:

Name | Type | Description
--- | --- | ---
`str` | string | is the string to be modified

Source:
  - src/main/js/common/GenUtils.js, line 1472

##### Returns:

the modified string with big numbers converted to strings

Type
  string

#### (static) toLowerCaseArray(arr)

Returns a copy of the given array where each element is lowercase.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arr` |  | is the array to convert to lowercase

Source:
  - src/main/js/common/GenUtils.js, line 575

##### Returns:

a copy of the given array where each element is lowercase

#### (static) toUniqueArray(arr)

Returns a new array containing unique elements of the given array.

##### Parameters:

Name | Type | Description
--- | --- | ---
`arr` |  | is the array to return unique elements from

Source:
  - src/main/js/common/GenUtils.js, line 531

##### Returns:

a new array with the given array's unique elements

#### (async, static) waitFor(durationMs)

Wait for the duration.

##### Parameters:

Name | Type | Description
--- | --- | ---
`durationMs` | number | the duration to wait for in milliseconds

Source:
  - src/main/js/common/GenUtils.js, line 1491