diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml
index c8b671a..7f723bb 100644
--- a/.gitlab-ci.yml
+++ b/.gitlab-ci.yml
@@ -150,7 +150,7 @@ sonar-success:
script:
- make node_modules
- sonar-scanner
- -Dsonar.projectKey=ssube_rollup-template
+ -Dsonar.projectKey=ssube_js-utils
-Dsonar.projectVersion=${CI_COMMIT_REF_SLUG}
-Dsonar.organization=ssube-github
-Dsonar.sources=src/,test/
diff --git a/config/eslint.json b/config/eslint.json
index a388976..dc1c719 100644
--- a/config/eslint.json
+++ b/config/eslint.json
@@ -154,7 +154,6 @@
"error",
"any",
"Number",
- "String",
"Boolean",
"Undefined"
],
diff --git a/config/rollup-named.json b/config/rollup-named.json
index b31da20..be1d2ca 100644
--- a/config/rollup-named.json
+++ b/config/rollup-named.json
@@ -2,5 +2,11 @@
"node_modules/chai/index.js": [
"expect",
"use"
+ ],
+ "node_modules/lodash/lodash.js": [
+ "isFunction",
+ "isMap",
+ "isObject",
+ "isString"
]
}
\ No newline at end of file
diff --git a/docs/api/index.md b/docs/api/index.md
index 5c5b582..e4b0089 100644
--- a/docs/api/index.md
+++ b/docs/api/index.md
@@ -8,5 +8,5 @@
| Package | Description |
| --- | --- |
-| [@apextoaster/rollup-template](./rollup-template.md) | |
+| [@apextoaster/js-utils](./js-utils.md) | |
diff --git a/docs/api/js-utils.arraymapper._constructor_.md b/docs/api/js-utils.arraymapper._constructor_.md
new file mode 100644
index 0000000..92a0fc9
--- /dev/null
+++ b/docs/api/js-utils.arraymapper._constructor_.md
@@ -0,0 +1,20 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ArrayMapper](./js-utils.arraymapper.md) > [(constructor)](./js-utils.arraymapper._constructor_.md)
+
+## ArrayMapper.(constructor)
+
+Constructs a new instance of the `ArrayMapper` class
+
+Signature:
+
+```typescript
+constructor(options: ArrayMapperOptions);
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| options | ArrayMapperOptions
| |
+
diff --git a/docs/api/js-utils.arraymapper.map.md b/docs/api/js-utils.arraymapper.map.md
new file mode 100644
index 0000000..a7b672c
--- /dev/null
+++ b/docs/api/js-utils.arraymapper.map.md
@@ -0,0 +1,22 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ArrayMapper](./js-utils.arraymapper.md) > [map](./js-utils.arraymapper.map.md)
+
+## ArrayMapper.map() method
+
+Signature:
+
+```typescript
+map(input: Array): Map>;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| input | Array<string>
| |
+
+Returns:
+
+`Map>`
+
diff --git a/docs/api/js-utils.arraymapper.md b/docs/api/js-utils.arraymapper.md
new file mode 100644
index 0000000..552a004
--- /dev/null
+++ b/docs/api/js-utils.arraymapper.md
@@ -0,0 +1,32 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ArrayMapper](./js-utils.arraymapper.md)
+
+## ArrayMapper class
+
+Signature:
+
+```typescript
+export declare class ArrayMapper
+```
+
+## Constructors
+
+| Constructor | Modifiers | Description |
+| --- | --- | --- |
+| [(constructor)(options)](./js-utils.arraymapper._constructor_.md) | | Constructs a new instance of the ArrayMapper
class |
+
+## Properties
+
+| Property | Modifiers | Type | Description |
+| --- | --- | --- | --- |
+| [rest](./js-utils.arraymapper.rest.md) | | string
| |
+| [skip](./js-utils.arraymapper.skip.md) | | number
| |
+| [take](./js-utils.arraymapper.take.md) | | Array<string>
| |
+
+## Methods
+
+| Method | Modifiers | Description |
+| --- | --- | --- |
+| [map(input)](./js-utils.arraymapper.map.md) | | |
+
diff --git a/docs/api/js-utils.arraymapper.rest.md b/docs/api/js-utils.arraymapper.rest.md
new file mode 100644
index 0000000..08464b6
--- /dev/null
+++ b/docs/api/js-utils.arraymapper.rest.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ArrayMapper](./js-utils.arraymapper.md) > [rest](./js-utils.arraymapper.rest.md)
+
+## ArrayMapper.rest property
+
+Signature:
+
+```typescript
+readonly rest: string;
+```
diff --git a/docs/api/js-utils.arraymapper.skip.md b/docs/api/js-utils.arraymapper.skip.md
new file mode 100644
index 0000000..ad04011
--- /dev/null
+++ b/docs/api/js-utils.arraymapper.skip.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ArrayMapper](./js-utils.arraymapper.md) > [skip](./js-utils.arraymapper.skip.md)
+
+## ArrayMapper.skip property
+
+Signature:
+
+```typescript
+readonly skip: number;
+```
diff --git a/docs/api/js-utils.arraymapper.take.md b/docs/api/js-utils.arraymapper.take.md
new file mode 100644
index 0000000..9b59ac5
--- /dev/null
+++ b/docs/api/js-utils.arraymapper.take.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ArrayMapper](./js-utils.arraymapper.md) > [take](./js-utils.arraymapper.take.md)
+
+## ArrayMapper.take property
+
+Signature:
+
+```typescript
+readonly take: Array;
+```
diff --git a/docs/api/js-utils.asynctracker._constructor_.md b/docs/api/js-utils.asynctracker._constructor_.md
new file mode 100644
index 0000000..7e179fe
--- /dev/null
+++ b/docs/api/js-utils.asynctracker._constructor_.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [AsyncTracker](./js-utils.asynctracker.md) > [(constructor)](./js-utils.asynctracker._constructor_.md)
+
+## AsyncTracker.(constructor)
+
+Constructs a new instance of the `AsyncTracker` class
+
+Signature:
+
+```typescript
+constructor();
+```
diff --git a/docs/api/js-utils.asynctracker.clear.md b/docs/api/js-utils.asynctracker.clear.md
new file mode 100644
index 0000000..f223a02
--- /dev/null
+++ b/docs/api/js-utils.asynctracker.clear.md
@@ -0,0 +1,15 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [AsyncTracker](./js-utils.asynctracker.md) > [clear](./js-utils.asynctracker.clear.md)
+
+## AsyncTracker.clear() method
+
+Signature:
+
+```typescript
+clear(): void;
+```
+Returns:
+
+`void`
+
diff --git a/docs/api/js-utils.asynctracker.disable.md b/docs/api/js-utils.asynctracker.disable.md
new file mode 100644
index 0000000..92a1591
--- /dev/null
+++ b/docs/api/js-utils.asynctracker.disable.md
@@ -0,0 +1,15 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [AsyncTracker](./js-utils.asynctracker.md) > [disable](./js-utils.asynctracker.disable.md)
+
+## AsyncTracker.disable() method
+
+Signature:
+
+```typescript
+disable(): void;
+```
+Returns:
+
+`void`
+
diff --git a/docs/api/js-utils.asynctracker.dump.md b/docs/api/js-utils.asynctracker.dump.md
new file mode 100644
index 0000000..16e432a
--- /dev/null
+++ b/docs/api/js-utils.asynctracker.dump.md
@@ -0,0 +1,15 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [AsyncTracker](./js-utils.asynctracker.md) > [dump](./js-utils.asynctracker.dump.md)
+
+## AsyncTracker.dump() method
+
+Signature:
+
+```typescript
+dump(): void;
+```
+Returns:
+
+`void`
+
diff --git a/docs/api/js-utils.asynctracker.enable.md b/docs/api/js-utils.asynctracker.enable.md
new file mode 100644
index 0000000..1c0afb6
--- /dev/null
+++ b/docs/api/js-utils.asynctracker.enable.md
@@ -0,0 +1,15 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [AsyncTracker](./js-utils.asynctracker.md) > [enable](./js-utils.asynctracker.enable.md)
+
+## AsyncTracker.enable() method
+
+Signature:
+
+```typescript
+enable(): void;
+```
+Returns:
+
+`void`
+
diff --git a/docs/api/js-utils.asynctracker.getstack.md b/docs/api/js-utils.asynctracker.getstack.md
new file mode 100644
index 0000000..844364b
--- /dev/null
+++ b/docs/api/js-utils.asynctracker.getstack.md
@@ -0,0 +1,15 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [AsyncTracker](./js-utils.asynctracker.md) > [getStack](./js-utils.asynctracker.getstack.md)
+
+## AsyncTracker.getStack() method
+
+Signature:
+
+```typescript
+static getStack(): string;
+```
+Returns:
+
+`string`
+
diff --git a/docs/api/js-utils.asynctracker.md b/docs/api/js-utils.asynctracker.md
new file mode 100644
index 0000000..fa23d30
--- /dev/null
+++ b/docs/api/js-utils.asynctracker.md
@@ -0,0 +1,38 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [AsyncTracker](./js-utils.asynctracker.md)
+
+## AsyncTracker class
+
+Async resource tracker using node's internal hooks.
+
+This probably won't work in a browser. It does not hold references to the resource, to avoid leaks. Adapted from https://gist.github.com/boneskull/7fe75b63d613fa940db7ec990a5f5843\#file-async-dump-js
+
+Signature:
+
+```typescript
+export declare class AsyncTracker
+```
+
+## Constructors
+
+| Constructor | Modifiers | Description |
+| --- | --- | --- |
+| [(constructor)()](./js-utils.asynctracker._constructor_.md) | | Constructs a new instance of the AsyncTracker
class |
+
+## Properties
+
+| Property | Modifiers | Type | Description |
+| --- | --- | --- | --- |
+| [size](./js-utils.asynctracker.size.md) | | number
| |
+
+## Methods
+
+| Method | Modifiers | Description |
+| --- | --- | --- |
+| [clear()](./js-utils.asynctracker.clear.md) | | |
+| [disable()](./js-utils.asynctracker.disable.md) | | |
+| [dump()](./js-utils.asynctracker.dump.md) | | |
+| [enable()](./js-utils.asynctracker.enable.md) | | |
+| [getStack()](./js-utils.asynctracker.getstack.md) | static
| |
+
diff --git a/docs/api/js-utils.asynctracker.size.md b/docs/api/js-utils.asynctracker.size.md
new file mode 100644
index 0000000..f5c8b8a
--- /dev/null
+++ b/docs/api/js-utils.asynctracker.size.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [AsyncTracker](./js-utils.asynctracker.md) > [size](./js-utils.asynctracker.size.md)
+
+## AsyncTracker.size property
+
+Signature:
+
+```typescript
+get size(): number;
+```
diff --git a/docs/api/js-utils.childprocesserror._constructor_.md b/docs/api/js-utils.childprocesserror._constructor_.md
new file mode 100644
index 0000000..30a0db3
--- /dev/null
+++ b/docs/api/js-utils.childprocesserror._constructor_.md
@@ -0,0 +1,21 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ChildProcessError](./js-utils.childprocesserror.md) > [(constructor)](./js-utils.childprocesserror._constructor_.md)
+
+## ChildProcessError.(constructor)
+
+Constructs a new instance of the `ChildProcessError` class
+
+Signature:
+
+```typescript
+constructor(msg?: string, ...nested: Array);
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| msg | string
| |
+| nested | Array<Error>
| |
+
diff --git a/docs/api/js-utils.childprocesserror.md b/docs/api/js-utils.childprocesserror.md
new file mode 100644
index 0000000..73e40eb
--- /dev/null
+++ b/docs/api/js-utils.childprocesserror.md
@@ -0,0 +1,18 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ChildProcessError](./js-utils.childprocesserror.md)
+
+## ChildProcessError class
+
+Signature:
+
+```typescript
+export declare class ChildProcessError extends BaseError
+```
+
+## Constructors
+
+| Constructor | Modifiers | Description |
+| --- | --- | --- |
+| [(constructor)(msg, nested)](./js-utils.childprocesserror._constructor_.md) | | Constructs a new instance of the ChildProcessError
class |
+
diff --git a/docs/api/js-utils.concat.md b/docs/api/js-utils.concat.md
new file mode 100644
index 0000000..b3dc778
--- /dev/null
+++ b/docs/api/js-utils.concat.md
@@ -0,0 +1,22 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [concat](./js-utils.concat.md)
+
+## concat() function
+
+Signature:
+
+```typescript
+export declare function concat(chunks: Array): Buffer;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| chunks | Array<Buffer>
| |
+
+Returns:
+
+`Buffer`
+
diff --git a/docs/api/js-utils.countof.md b/docs/api/js-utils.countof.md
new file mode 100644
index 0000000..8e29555
--- /dev/null
+++ b/docs/api/js-utils.countof.md
@@ -0,0 +1,26 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [countOf](./js-utils.countof.md)
+
+## countOf() function
+
+Calculate the "length" of an array or value.
+
+Arrays return their length, single values return 1, and nil values return 0. This counts the number of elements that setOrPush would add.
+
+Signature:
+
+```typescript
+export declare function countOf(val: unknown): number;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| val | unknown
| |
+
+Returns:
+
+`number`
+
diff --git a/docs/api/js-utils.defaultwhen.md b/docs/api/js-utils.defaultwhen.md
new file mode 100644
index 0000000..789c455
--- /dev/null
+++ b/docs/api/js-utils.defaultwhen.md
@@ -0,0 +1,23 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [defaultWhen](./js-utils.defaultwhen.md)
+
+## defaultWhen() function
+
+Signature:
+
+```typescript
+export declare function defaultWhen(condition: boolean, ...items: Array): TVal;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| condition | boolean
| |
+| items | Array<TVal>
| |
+
+Returns:
+
+`TVal`
+
diff --git a/docs/api/js-utils.defer.md b/docs/api/js-utils.defer.md
new file mode 100644
index 0000000..469f26f
--- /dev/null
+++ b/docs/api/js-utils.defer.md
@@ -0,0 +1,25 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [defer](./js-utils.defer.md)
+
+## defer() function
+
+Resolve after a set amount of time.
+
+Signature:
+
+```typescript
+export declare function defer(ms: number, val?: T): Promise;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| ms | number
| |
+| val | T
| |
+
+Returns:
+
+`Promise`
+
diff --git a/docs/api/js-utils.dict.md b/docs/api/js-utils.dict.md
new file mode 100644
index 0000000..985d78b
--- /dev/null
+++ b/docs/api/js-utils.dict.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [Dict](./js-utils.dict.md)
+
+## Dict interface
+
+Signature:
+
+```typescript
+export interface Dict
+```
diff --git a/docs/api/js-utils.doesexist.md b/docs/api/js-utils.doesexist.md
new file mode 100644
index 0000000..115b812
--- /dev/null
+++ b/docs/api/js-utils.doesexist.md
@@ -0,0 +1,24 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [doesExist](./js-utils.doesexist.md)
+
+## doesExist() function
+
+Check if a variable is not nil.
+
+Signature:
+
+```typescript
+export declare function doesExist(val: Optional): val is T;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| val | Optional<T>
| |
+
+Returns:
+
+`val is T`
+
diff --git a/docs/api/js-utils.encode.md b/docs/api/js-utils.encode.md
new file mode 100644
index 0000000..a69a62c
--- /dev/null
+++ b/docs/api/js-utils.encode.md
@@ -0,0 +1,23 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [encode](./js-utils.encode.md)
+
+## encode() function
+
+Signature:
+
+```typescript
+export declare function encode(chunks: Array, encoding: string): string;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| chunks | Array<Buffer>
| |
+| encoding | string
| |
+
+Returns:
+
+`string`
+
diff --git a/docs/api/js-utils.entriesof.md b/docs/api/js-utils.entriesof.md
new file mode 100644
index 0000000..75c899e
--- /dev/null
+++ b/docs/api/js-utils.entriesof.md
@@ -0,0 +1,22 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [entriesOf](./js-utils.entriesof.md)
+
+## entriesOf() function
+
+Signature:
+
+```typescript
+export declare function entriesOf(map: Optional>): Array<[string, TVal]>;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| map | Optional<MapLike<TVal>>
| |
+
+Returns:
+
+`Array<[string, TVal]>`
+
diff --git a/docs/api/js-utils.externalmodule.data.md b/docs/api/js-utils.externalmodule.data.md
new file mode 100644
index 0000000..8cc84dc
--- /dev/null
+++ b/docs/api/js-utils.externalmodule.data.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ExternalModule](./js-utils.externalmodule.md) > [data](./js-utils.externalmodule.data.md)
+
+## ExternalModule.data property
+
+Signature:
+
+```typescript
+data?: unknown;
+```
diff --git a/docs/api/js-utils.externalmodule.export.md b/docs/api/js-utils.externalmodule.export.md
new file mode 100644
index 0000000..7719542
--- /dev/null
+++ b/docs/api/js-utils.externalmodule.export.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ExternalModule](./js-utils.externalmodule.md) > [export](./js-utils.externalmodule.export.md)
+
+## ExternalModule.export property
+
+Signature:
+
+```typescript
+export: string;
+```
diff --git a/docs/api/js-utils.externalmodule.md b/docs/api/js-utils.externalmodule.md
new file mode 100644
index 0000000..5910888
--- /dev/null
+++ b/docs/api/js-utils.externalmodule.md
@@ -0,0 +1,20 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ExternalModule](./js-utils.externalmodule.md)
+
+## ExternalModule interface
+
+Signature:
+
+```typescript
+export interface ExternalModule
+```
+
+## Properties
+
+| Property | Type | Description |
+| --- | --- | --- |
+| [data](./js-utils.externalmodule.data.md) | unknown
| |
+| [export](./js-utils.externalmodule.export.md) | string
| |
+| [require](./js-utils.externalmodule.require.md) | string
| |
+
diff --git a/docs/api/js-utils.externalmodule.require.md b/docs/api/js-utils.externalmodule.require.md
new file mode 100644
index 0000000..a499da4
--- /dev/null
+++ b/docs/api/js-utils.externalmodule.require.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ExternalModule](./js-utils.externalmodule.md) > [require](./js-utils.externalmodule.require.md)
+
+## ExternalModule.require property
+
+Signature:
+
+```typescript
+require: string;
+```
diff --git a/docs/api/js-utils.filternil.md b/docs/api/js-utils.filternil.md
new file mode 100644
index 0000000..fdc6b27
--- /dev/null
+++ b/docs/api/js-utils.filternil.md
@@ -0,0 +1,24 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [filterNil](./js-utils.filternil.md)
+
+## filterNil() function
+
+Remove any null or undefined items from the list.
+
+Signature:
+
+```typescript
+export declare function filterNil(list: ArrayLike>): Array;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| list | ArrayLike<Optional<TItem>>
| |
+
+Returns:
+
+`Array`
+
diff --git a/docs/api/js-utils.gettestlogger.md b/docs/api/js-utils.gettestlogger.md
new file mode 100644
index 0000000..729bfbf
--- /dev/null
+++ b/docs/api/js-utils.gettestlogger.md
@@ -0,0 +1,22 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [getTestLogger](./js-utils.gettestlogger.md)
+
+## getTestLogger() function
+
+Signature:
+
+```typescript
+export declare function getTestLogger(verbose?: boolean): Logger;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| verbose | boolean
| |
+
+Returns:
+
+`Logger`
+
diff --git a/docs/api/js-utils.invalidargumenterror._constructor_.md b/docs/api/js-utils.invalidargumenterror._constructor_.md
new file mode 100644
index 0000000..8d3d12b
--- /dev/null
+++ b/docs/api/js-utils.invalidargumenterror._constructor_.md
@@ -0,0 +1,21 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [InvalidArgumentError](./js-utils.invalidargumenterror.md) > [(constructor)](./js-utils.invalidargumenterror._constructor_.md)
+
+## InvalidArgumentError.(constructor)
+
+Constructs a new instance of the `InvalidArgumentError` class
+
+Signature:
+
+```typescript
+constructor(msg?: string, ...nested: Array);
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| msg | string
| |
+| nested | Array<Error>
| |
+
diff --git a/docs/api/js-utils.invalidargumenterror.md b/docs/api/js-utils.invalidargumenterror.md
new file mode 100644
index 0000000..a4f9056
--- /dev/null
+++ b/docs/api/js-utils.invalidargumenterror.md
@@ -0,0 +1,18 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [InvalidArgumentError](./js-utils.invalidargumenterror.md)
+
+## InvalidArgumentError class
+
+Signature:
+
+```typescript
+export declare class InvalidArgumentError extends BaseError
+```
+
+## Constructors
+
+| Constructor | Modifiers | Description |
+| --- | --- | --- |
+| [(constructor)(msg, nested)](./js-utils.invalidargumenterror._constructor_.md) | | Constructs a new instance of the InvalidArgumentError
class |
+
diff --git a/docs/api/js-utils.isdebug.md b/docs/api/js-utils.isdebug.md
new file mode 100644
index 0000000..d9a0305
--- /dev/null
+++ b/docs/api/js-utils.isdebug.md
@@ -0,0 +1,15 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [isDebug](./js-utils.isdebug.md)
+
+## isDebug() function
+
+Signature:
+
+```typescript
+export declare function isDebug(): boolean;
+```
+Returns:
+
+`boolean`
+
diff --git a/docs/api/js-utils.isnil.md b/docs/api/js-utils.isnil.md
new file mode 100644
index 0000000..e8e4a14
--- /dev/null
+++ b/docs/api/js-utils.isnil.md
@@ -0,0 +1,22 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [isNil](./js-utils.isnil.md)
+
+## isNil() function
+
+Signature:
+
+```typescript
+export declare function isNil(val: Optional): val is Nil;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| val | Optional<T>
| |
+
+Returns:
+
+`val is Nil`
+
diff --git a/docs/api/js-utils.makedict.md b/docs/api/js-utils.makedict.md
new file mode 100644
index 0000000..1336a84
--- /dev/null
+++ b/docs/api/js-utils.makedict.md
@@ -0,0 +1,24 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [makeDict](./js-utils.makedict.md)
+
+## makeDict() function
+
+Turns a map or dict into a dict
+
+Signature:
+
+```typescript
+export declare function makeDict(map: Optional>): Dict;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| map | Optional<MapLike<TVal>>
| |
+
+Returns:
+
+`Dict`
+
diff --git a/docs/api/js-utils.makemap.md b/docs/api/js-utils.makemap.md
new file mode 100644
index 0000000..0749acd
--- /dev/null
+++ b/docs/api/js-utils.makemap.md
@@ -0,0 +1,24 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [makeMap](./js-utils.makemap.md)
+
+## makeMap() function
+
+Clone a map or map-like object into a new map.
+
+Signature:
+
+```typescript
+export declare function makeMap(val: Optional>): Map;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| val | Optional<MapLike<TVal>>
| |
+
+Returns:
+
+`Map`
+
diff --git a/docs/api/js-utils.maplike.md b/docs/api/js-utils.maplike.md
new file mode 100644
index 0000000..ec100a5
--- /dev/null
+++ b/docs/api/js-utils.maplike.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [MapLike](./js-utils.maplike.md)
+
+## MapLike type
+
+A `Map` or dictionary object with string keys and `TVal` values.
+
+Signature:
+
+```typescript
+export declare type MapLike = Map | Dict;
+```
diff --git a/docs/api/js-utils.md b/docs/api/js-utils.md
new file mode 100644
index 0000000..6369b93
--- /dev/null
+++ b/docs/api/js-utils.md
@@ -0,0 +1,75 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md)
+
+## js-utils package
+
+## Classes
+
+| Class | Description |
+| --- | --- |
+| [ArrayMapper](./js-utils.arraymapper.md) | |
+| [AsyncTracker](./js-utils.asynctracker.md) | Async resource tracker using node's internal hooks.This probably won't work in a browser. It does not hold references to the resource, to avoid leaks. Adapted from https://gist.github.com/boneskull/7fe75b63d613fa940db7ec990a5f5843\#file-async-dump-js |
+| [ChildProcessError](./js-utils.childprocesserror.md) | |
+| [InvalidArgumentError](./js-utils.invalidargumenterror.md) | |
+| [MissingKeyError](./js-utils.missingkeyerror.md) | |
+| [NotFoundError](./js-utils.notfounderror.md) | |
+| [NotImplementedError](./js-utils.notimplementederror.md) | |
+| [TimeoutError](./js-utils.timeouterror.md) | |
+
+## Functions
+
+| Function | Description |
+| --- | --- |
+| [concat(chunks)](./js-utils.concat.md) | |
+| [countOf(val)](./js-utils.countof.md) | Calculate the "length" of an array or value.Arrays return their length, single values return 1, and nil values return 0. This counts the number of elements that setOrPush would add. |
+| [defaultWhen(condition, items)](./js-utils.defaultwhen.md) | |
+| [defer(ms, val)](./js-utils.defer.md) | Resolve after a set amount of time. |
+| [doesExist(val)](./js-utils.doesexist.md) | Check if a variable is not nil. |
+| [encode(chunks, encoding)](./js-utils.encode.md) | |
+| [entriesOf(map)](./js-utils.entriesof.md) | |
+| [filterNil(list)](./js-utils.filternil.md) | Remove any null or undefined items from the list. |
+| [getTestLogger(verbose)](./js-utils.gettestlogger.md) | |
+| [isDebug()](./js-utils.isdebug.md) | |
+| [isNil(val)](./js-utils.isnil.md) | |
+| [makeDict(map)](./js-utils.makedict.md) | Turns a map or dict into a dict |
+| [makeMap(val)](./js-utils.makemap.md) | Clone a map or map-like object into a new map. |
+| [mergeList(parts)](./js-utils.mergelist.md) | Merge arguments, which may or may not be arrays, into one return that is definitely an array. |
+| [mergeMap(target, source)](./js-utils.mergemap.md) | |
+| [mustCoalesce(values)](./js-utils.mustcoalesce.md) | Return the first value that is not nil. |
+| [mustExist(val)](./js-utils.mustexist.md) | Assert that a variable is not nil and return the value. |
+| [mustFind(list, predicate)](./js-utils.mustfind.md) | Find a value matching the given predicate or throw. |
+| [mustGet(map, key)](./js-utils.mustget.md) | Get an element from a Map and guard against nil values. |
+| [pushMergeMap(args)](./js-utils.pushmergemap.md) | |
+| [removePid(path)](./js-utils.removepid.md) | |
+| [setOrPush(map, key, val)](./js-utils.setorpush.md) | Set a map key to a new array or push to the existing value. |
+| [signal(signals)](./js-utils.signal.md) | |
+| [spyLogger(spies)](./js-utils.spylogger.md) | |
+| [timeout(ms, oper)](./js-utils.timeout.md) | Reject after a set amount of time if the original promise has not yet resolved. |
+| [waitForChild(child)](./js-utils.waitforchild.md) | |
+| [writePid(path)](./js-utils.writepid.md) | |
+
+## Interfaces
+
+| Interface | Description |
+| --- | --- |
+| [Dict](./js-utils.dict.md) | |
+| [ExternalModule](./js-utils.externalmodule.md) | |
+
+## Variables
+
+| Variable | Description |
+| --- | --- |
+| [SIGNAL\_RELOAD](./js-utils.signal_reload.md) | |
+| [SIGNAL\_RESET](./js-utils.signal_reset.md) | |
+| [SIGNAL\_STOP](./js-utils.signal_stop.md) | |
+
+## Type Aliases
+
+| Type Alias | Description |
+| --- | --- |
+| [MapLike](./js-utils.maplike.md) | A Map
or dictionary object with string keys and TVal
values. |
+| [ModuleCtor](./js-utils.modulector.md) | |
+| [Nil](./js-utils.nil.md) | Unset value. |
+| [Optional](./js-utils.optional.md) | Value that may be nil. |
+
diff --git a/docs/api/js-utils.mergelist.md b/docs/api/js-utils.mergelist.md
new file mode 100644
index 0000000..0f41eb7
--- /dev/null
+++ b/docs/api/js-utils.mergelist.md
@@ -0,0 +1,24 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [mergeList](./js-utils.mergelist.md)
+
+## mergeList() function
+
+Merge arguments, which may or may not be arrays, into one return that is definitely an array.
+
+Signature:
+
+```typescript
+export declare function mergeList(...parts: Array>): Array;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| parts | Array<TItem | Array<TItem>>
| |
+
+Returns:
+
+`Array`
+
diff --git a/docs/api/js-utils.mergemap.md b/docs/api/js-utils.mergemap.md
new file mode 100644
index 0000000..2be0058
--- /dev/null
+++ b/docs/api/js-utils.mergemap.md
@@ -0,0 +1,23 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [mergeMap](./js-utils.mergemap.md)
+
+## mergeMap() function
+
+Signature:
+
+```typescript
+export declare function mergeMap(target: Map, source: Map | Array<[TKey, TVal]>): Map;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| target | Map<TKey, TVal>
| |
+| source | Map<TKey, TVal> | Array<[TKey, TVal]>
| |
+
+Returns:
+
+`Map`
+
diff --git a/docs/api/js-utils.missingkeyerror._constructor_.md b/docs/api/js-utils.missingkeyerror._constructor_.md
new file mode 100644
index 0000000..636d600
--- /dev/null
+++ b/docs/api/js-utils.missingkeyerror._constructor_.md
@@ -0,0 +1,21 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [MissingKeyError](./js-utils.missingkeyerror.md) > [(constructor)](./js-utils.missingkeyerror._constructor_.md)
+
+## MissingKeyError.(constructor)
+
+Constructs a new instance of the `MissingKeyError` class
+
+Signature:
+
+```typescript
+constructor(msg?: string, ...nested: Array);
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| msg | string
| |
+| nested | Array<Error>
| |
+
diff --git a/docs/api/js-utils.missingkeyerror.md b/docs/api/js-utils.missingkeyerror.md
new file mode 100644
index 0000000..ab29b2d
--- /dev/null
+++ b/docs/api/js-utils.missingkeyerror.md
@@ -0,0 +1,18 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [MissingKeyError](./js-utils.missingkeyerror.md)
+
+## MissingKeyError class
+
+Signature:
+
+```typescript
+export declare class MissingKeyError extends BaseError
+```
+
+## Constructors
+
+| Constructor | Modifiers | Description |
+| --- | --- | --- |
+| [(constructor)(msg, nested)](./js-utils.missingkeyerror._constructor_.md) | | Constructs a new instance of the MissingKeyError
class |
+
diff --git a/docs/api/js-utils.modulector.md b/docs/api/js-utils.modulector.md
new file mode 100644
index 0000000..a6d09d4
--- /dev/null
+++ b/docs/api/js-utils.modulector.md
@@ -0,0 +1,11 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ModuleCtor](./js-utils.modulector.md)
+
+## ModuleCtor type
+
+Signature:
+
+```typescript
+export declare type ModuleCtor = new (data: unknown) => Module;
+```
diff --git a/docs/api/js-utils.mustcoalesce.md b/docs/api/js-utils.mustcoalesce.md
new file mode 100644
index 0000000..ecc0a8a
--- /dev/null
+++ b/docs/api/js-utils.mustcoalesce.md
@@ -0,0 +1,24 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [mustCoalesce](./js-utils.mustcoalesce.md)
+
+## mustCoalesce() function
+
+Return the first value that is not nil.
+
+Signature:
+
+```typescript
+export declare function mustCoalesce(...values: Array>): T;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| values | Array<Optional<T>>
| |
+
+Returns:
+
+`T`
+
diff --git a/docs/api/js-utils.mustexist.md b/docs/api/js-utils.mustexist.md
new file mode 100644
index 0000000..3300a80
--- /dev/null
+++ b/docs/api/js-utils.mustexist.md
@@ -0,0 +1,30 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [mustExist](./js-utils.mustexist.md)
+
+## mustExist() function
+
+Assert that a variable is not nil and return the value.
+
+Signature:
+
+```typescript
+export declare function mustExist(val: Optional): T;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| val | Optional<T>
| |
+
+Returns:
+
+`T`
+
+val
+
+## Exceptions
+
+NotFoundError
+
diff --git a/docs/api/js-utils.mustfind.md b/docs/api/js-utils.mustfind.md
new file mode 100644
index 0000000..f78dd00
--- /dev/null
+++ b/docs/api/js-utils.mustfind.md
@@ -0,0 +1,25 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [mustFind](./js-utils.mustfind.md)
+
+## mustFind() function
+
+Find a value matching the given predicate or throw.
+
+Signature:
+
+```typescript
+export declare function mustFind(list: Array>, predicate: PredicateC1): TVal;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| list | Array<Optional<TVal>>
| |
+| predicate | PredicateC1<TVal>
| |
+
+Returns:
+
+`TVal`
+
diff --git a/docs/api/js-utils.mustget.md b/docs/api/js-utils.mustget.md
new file mode 100644
index 0000000..d085a26
--- /dev/null
+++ b/docs/api/js-utils.mustget.md
@@ -0,0 +1,25 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [mustGet](./js-utils.mustget.md)
+
+## mustGet() function
+
+Get an element from a Map and guard against nil values.
+
+Signature:
+
+```typescript
+export declare function mustGet(map: Map, key: TKey): TVal;
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| map | Map<TKey, TVal>
| |
+| key | TKey
| |
+
+Returns:
+
+`TVal`
+
diff --git a/docs/api/js-utils.nil.md b/docs/api/js-utils.nil.md
new file mode 100644
index 0000000..929829f
--- /dev/null
+++ b/docs/api/js-utils.nil.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [Nil](./js-utils.nil.md)
+
+## Nil type
+
+Unset value.
+
+Signature:
+
+```typescript
+export declare type Nil = null | undefined;
+```
diff --git a/docs/api/js-utils.notfounderror._constructor_.md b/docs/api/js-utils.notfounderror._constructor_.md
new file mode 100644
index 0000000..65b7c57
--- /dev/null
+++ b/docs/api/js-utils.notfounderror._constructor_.md
@@ -0,0 +1,21 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [NotFoundError](./js-utils.notfounderror.md) > [(constructor)](./js-utils.notfounderror._constructor_.md)
+
+## NotFoundError.(constructor)
+
+Constructs a new instance of the `NotFoundError` class
+
+Signature:
+
+```typescript
+constructor(msg?: string, ...nested: Array);
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| msg | string
| |
+| nested | Array<Error>
| |
+
diff --git a/docs/api/js-utils.notfounderror.md b/docs/api/js-utils.notfounderror.md
new file mode 100644
index 0000000..a6d7e29
--- /dev/null
+++ b/docs/api/js-utils.notfounderror.md
@@ -0,0 +1,18 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [NotFoundError](./js-utils.notfounderror.md)
+
+## NotFoundError class
+
+Signature:
+
+```typescript
+export declare class NotFoundError extends BaseError
+```
+
+## Constructors
+
+| Constructor | Modifiers | Description |
+| --- | --- | --- |
+| [(constructor)(msg, nested)](./js-utils.notfounderror._constructor_.md) | | Constructs a new instance of the NotFoundError
class |
+
diff --git a/docs/api/js-utils.notimplementederror._constructor_.md b/docs/api/js-utils.notimplementederror._constructor_.md
new file mode 100644
index 0000000..3fe412a
--- /dev/null
+++ b/docs/api/js-utils.notimplementederror._constructor_.md
@@ -0,0 +1,21 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [NotImplementedError](./js-utils.notimplementederror.md) > [(constructor)](./js-utils.notimplementederror._constructor_.md)
+
+## NotImplementedError.(constructor)
+
+Constructs a new instance of the `NotImplementedError` class
+
+Signature:
+
+```typescript
+constructor(msg?: string, ...nested: Array);
+```
+
+## Parameters
+
+| Parameter | Type | Description |
+| --- | --- | --- |
+| msg | string
| |
+| nested | Array<Error>
| |
+
diff --git a/docs/api/js-utils.notimplementederror.md b/docs/api/js-utils.notimplementederror.md
new file mode 100644
index 0000000..f370cd6
--- /dev/null
+++ b/docs/api/js-utils.notimplementederror.md
@@ -0,0 +1,18 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [NotImplementedError](./js-utils.notimplementederror.md)
+
+## NotImplementedError class
+
+Signature:
+
+```typescript
+export declare class NotImplementedError extends BaseError
+```
+
+## Constructors
+
+| Constructor | Modifiers | Description |
+| --- | --- | --- |
+| [(constructor)(msg, nested)](./js-utils.notimplementederror._constructor_.md) | | Constructs a new instance of the NotImplementedError
class |
+
diff --git a/docs/api/js-utils.optional.md b/docs/api/js-utils.optional.md
new file mode 100644
index 0000000..d345543
--- /dev/null
+++ b/docs/api/js-utils.optional.md
@@ -0,0 +1,13 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [Optional](./js-utils.optional.md)
+
+## Optional type
+
+Value that may be nil.
+
+Signature:
+
+```typescript
+export declare type Optional = T | Nil;
+```
diff --git a/docs/api/js-utils.pushmergemap.md b/docs/api/js-utils.pushmergemap.md
new file mode 100644
index 0000000..a96e0ad
--- /dev/null
+++ b/docs/api/js-utils.pushmergemap.md
@@ -0,0 +1,22 @@
+
+
+[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [pushMergeMap](./js-utils.pushmergemap.md)
+
+## pushMergeMap() function
+
+Signature:
+
+```typescript
+export declare function pushMergeMap(...args: Array