1
0
Fork 0

feat(build): bundle as ES module

BREAKING CHANGE: removes the umd module in favor of a smaller, standard
ES module. Consumers will need native support for ES modules (recent
evergreen browsers) or a bundler with the same (rollup, webpack, etc).
This commit is contained in:
ssube 2020-06-29 18:23:16 -05:00
parent 9d5be03d29
commit 040fecc6e3
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
74 changed files with 899 additions and 174 deletions

View File

@ -109,7 +109,10 @@ test: ## run mocha unit tests
test: test-cover
test-check: ## run mocha unit tests with coverage reports
$(NODE_BIN)/nyc $(COVER_OPTS) $(NODE_BIN)/mocha $(MOCHA_OPTS) $(TARGET_PATH)/test.js
$(NODE_BIN)/nyc $(COVER_OPTS) \
$(NODE_BIN)/mocha $(MOCHA_OPTS) \
--require esm \
$(TARGET_PATH)/test.js
test-cover: ## run mocha unit tests with coverage reports
test-cover: test-check

View File

@ -3,22 +3,20 @@ import commonjs from 'rollup-plugin-commonjs';
import { eslint } from 'rollup-plugin-eslint';
import json from 'rollup-plugin-json';
import multiEntry from 'rollup-plugin-multi-entry';
import externals from 'rollup-plugin-node-externals';
import builtins from 'rollup-plugin-node-builtins';
import globals from 'rollup-plugin-node-globals';
import resolve from 'rollup-plugin-node-resolve';
import replace from 'rollup-plugin-replace';
import typescript from 'rollup-plugin-typescript2';
import visualizer from 'rollup-plugin-visualizer';
import yaml from 'rollup-plugin-yaml';
const debug = process.env['DEBUG'] === 'TRUE';
const flag_debug = process.env['DEBUG'] === 'TRUE';
const metadata = require('../package.json');
const external = require('./rollup-external.json').names;
const globals = require('./rollup-globals.json');
const namedExports = require('./rollup-named.json');
const stubNames = require('./rollup-stub.json').names;
const passStub = 'require("pass-stub")';
const stubs = stubNames.reduce((p, c) => (p[c] = passStub, p), {});
const rootPath = process.env['ROOT_PATH'];
const targetPath = process.env['TARGET_PATH'];
@ -41,6 +39,14 @@ const bundle = {
return 'vendor';
}
if (id.match(/node-resolve:/)) {
return 'vendor';
}
/* if (id.includes(`chai`) || id.includes(`sinon`)) {
return 'test';
} */
if (id.includes(`${sep}node_modules${sep}`)) {
return 'vendor';
}
@ -49,12 +55,16 @@ const bundle = {
return 'index';
}
if (id.includes(`${sep}src${sep}`)) {
if (id.includes(`${sep}src${sep}`) || id.includes(`${sep}rules${sep}`)) {
return 'main';
}
if (debug) {
console.log('file belongs to no chunk', id);
if (flag_debug) {
console.log('file does not belong to any chunk:', id);
}
if (id.length === 30 && id.match(/^[a-f0-9]+$/)) {
return 'vendor';
}
return 'nochunk';
@ -63,28 +73,13 @@ const bundle = {
dir: targetPath,
chunkFileNames: '[name].js',
entryFileNames: 'entry-[name].js',
format: 'cjs',
globals,
format: 'module',
sourcemap: true,
},
plugins: [
multiEntry(),
json(),
yaml(),
externals({
builtins: true,
deps: true,
devDeps: false,
peerDeps: false,
}),
replace({
delimiters: ['require("', '")'],
values: stubs,
}),
replace({
delimiters: ['require(\'', '\')'],
values: stubs,
}),
replace({
delimiters: ['{{ ', ' }}'],
values: {
@ -103,6 +98,7 @@ const bundle = {
commonjs({
namedExports,
}),
globals(),
eslint({
configFile: join('.', 'config', 'eslint.json'),
exclude: [
@ -112,14 +108,20 @@ const bundle = {
join('src', '**', '*.yml'),
],
include: [
join('**', '*.ts'),
join('src', '**', '*.ts'),
join('test', '**', '*.ts'),
],
throwOnError: true,
useEslintrc: false,
}),
typescript({
cacheRoot: join(targetPath, 'cache', 'rts2'),
rollupCommonJSResolveHack: true,
}),
visualizer({
filename: join(rootPath, 'out', 'bundle-graph.html'),
sourcemap: true,
}),
],
};

View File

@ -16,5 +16,5 @@ constructor(options: ArrayMapperOptions);
| Parameter | Type | Description |
| --- | --- | --- |
| options | <code>ArrayMapperOptions</code> | |
| options | [ArrayMapperOptions](./js-utils.arraymapperoptions.md) | |

View File

@ -16,9 +16,9 @@ map(input: Array<string>): Map<string, Array<string>>;
| Parameter | Type | Description |
| --- | --- | --- |
| input | <code>Array&lt;string&gt;</code> | |
| input | Array&lt;string&gt; | |
<b>Returns:</b>
`Map<string, Array<string>>`
Map&lt;string, Array&lt;string&gt;&gt;

View File

@ -22,9 +22,9 @@ export declare class ArrayMapper
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [rest](./js-utils.arraymapper.rest.md) | | <code>string</code> | |
| [skip](./js-utils.arraymapper.skip.md) | | <code>number</code> | |
| [take](./js-utils.arraymapper.take.md) | | <code>Array&lt;string&gt;</code> | |
| [rest](./js-utils.arraymapper.rest.md) | | string | |
| [skip](./js-utils.arraymapper.skip.md) | | number | |
| [take](./js-utils.arraymapper.take.md) | | Array&lt;string&gt; | |
## Methods

View File

@ -14,7 +14,7 @@ export interface ArrayMapperOptions
| Property | Type | Description |
| --- | --- | --- |
| [rest](./js-utils.arraymapperoptions.rest.md) | <code>string</code> | Key for any remaining, unmatched elements. |
| [skip](./js-utils.arraymapperoptions.skip.md) | <code>number</code> | Number of initial elements to skip. |
| [take](./js-utils.arraymapperoptions.take.md) | <code>Array&lt;string&gt;</code> | List of element keys. |
| [rest](./js-utils.arraymapperoptions.rest.md) | string | Key for any remaining, unmatched elements. |
| [skip](./js-utils.arraymapperoptions.skip.md) | number | Number of initial elements to skip. |
| [take](./js-utils.arraymapperoptions.take.md) | Array&lt;string&gt; | List of element keys. |

View File

@ -11,5 +11,5 @@ clear(): void;
```
<b>Returns:</b>
`void`
void

View File

@ -11,5 +11,5 @@ disable(): void;
```
<b>Returns:</b>
`void`
void

View File

@ -13,5 +13,5 @@ dump(): void;
```
<b>Returns:</b>
`void`
void

View File

@ -11,5 +11,5 @@ enable(): void;
```
<b>Returns:</b>
`void`
void

View File

@ -13,5 +13,5 @@ getStack(): string;
```
<b>Returns:</b>
`string`
string

View File

@ -24,8 +24,8 @@ export declare class AsyncTracker
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [filter](./js-utils.asynctracker.filter.md) | | <code>Optional&lt;StackFilter&gt;</code> | |
| [size](./js-utils.asynctracker.size.md) | | <code>number</code> | |
| [filter](./js-utils.asynctracker.filter.md) | | [Optional](./js-utils.optional.md)<!-- -->&lt;StackFilter&gt; | |
| [size](./js-utils.asynctracker.size.md) | | number | |
## Methods

View File

@ -16,5 +16,5 @@ constructor(options: ChecklistOptions<T>);
| Parameter | Type | Description |
| --- | --- | --- |
| options | <code>ChecklistOptions&lt;T&gt;</code> | |
| options | [ChecklistOptions](./js-utils.checklistoptions.md)<!-- -->&lt;T&gt; | |

View File

@ -14,9 +14,9 @@ check(value: T): boolean;
| Parameter | Type | Description |
| --- | --- | --- |
| value | <code>T</code> | |
| value | T | |
<b>Returns:</b>
`boolean`
boolean

View File

@ -11,6 +11,7 @@ Check whether items are included or not (blacklist or whitelist, depending on `m
```typescript
export declare class Checklist<T> implements ChecklistOptions<T>
```
<b>Implements:</b> [ChecklistOptions](./js-utils.checklistoptions.md)<!-- -->&lt;T&gt;
## Constructors
@ -22,8 +23,8 @@ export declare class Checklist<T> implements ChecklistOptions<T>
| Property | Modifiers | Type | Description |
| --- | --- | --- | --- |
| [data](./js-utils.checklist.data.md) | | <code>Array&lt;T&gt;</code> | TODO: switch to Set |
| [mode](./js-utils.checklist.mode.md) | | <code>ChecklistMode</code> | |
| [data](./js-utils.checklist.data.md) | | Array&lt;T&gt; | TODO: switch to Set |
| [mode](./js-utils.checklist.mode.md) | | [ChecklistMode](./js-utils.checklistmode.md) | |
## Methods

View File

@ -14,6 +14,6 @@ export interface ChecklistOptions<T>
| Property | Type | Description |
| --- | --- | --- |
| [data](./js-utils.checklistoptions.data.md) | <code>Array&lt;T&gt;</code> | |
| [mode](./js-utils.checklistoptions.mode.md) | <code>ChecklistMode</code> | |
| [data](./js-utils.checklistoptions.data.md) | Array&lt;T&gt; | |
| [mode](./js-utils.checklistoptions.mode.md) | [ChecklistMode](./js-utils.checklistmode.md) | |

View File

@ -9,11 +9,12 @@
```typescript
export interface ChildOptions extends ChildProcessOptions
```
<b>Extends:</b> ChildProcessOptions
## Properties
| Property | Type | Description |
| --- | --- | --- |
| [args](./js-utils.childoptions.args.md) | <code>Array&lt;string&gt;</code> | |
| [command](./js-utils.childoptions.command.md) | <code>string</code> | |
| [args](./js-utils.childoptions.args.md) | Array&lt;string&gt; | |
| [command](./js-utils.childoptions.command.md) | string | |

View File

@ -16,6 +16,6 @@ constructor(msg?: string, ...nested: Array<Error>);
| Parameter | Type | Description |
| --- | --- | --- |
| msg | <code>string</code> | |
| nested | <code>Array&lt;Error&gt;</code> | |
| msg | string | |
| nested | Array&lt;Error&gt; | |

View File

@ -11,6 +11,7 @@ Error indicating that a child process exited with an error status.
```typescript
export declare class ChildProcessError extends BaseError
```
<b>Extends:</b> BaseError
## Constructors

View File

@ -14,7 +14,7 @@ export interface ChildResult
| Property | Type | Description |
| --- | --- | --- |
| [status](./js-utils.childresult.status.md) | <code>number</code> | |
| [stderr](./js-utils.childresult.stderr.md) | <code>string</code> | |
| [stdout](./js-utils.childresult.stdout.md) | <code>string</code> | |
| [status](./js-utils.childresult.status.md) | number | |
| [stderr](./js-utils.childresult.stderr.md) | string | |
| [stdout](./js-utils.childresult.stdout.md) | string | |

View File

@ -16,9 +16,9 @@ export declare function concat(chunks: Array<Buffer>): Buffer;
| Parameter | Type | Description |
| --- | --- | --- |
| chunks | <code>Array&lt;Buffer&gt;</code> | |
| chunks | Array&lt;Buffer&gt; | |
<b>Returns:</b>
`Buffer`
Buffer

View File

@ -16,9 +16,9 @@ export declare function constructorName(val: object): string;
| Parameter | Type | Description |
| --- | --- | --- |
| val | <code>object</code> | |
| val | object | |
<b>Returns:</b>
`string`
string

View File

@ -18,9 +18,9 @@ export declare function countOf(val: unknown): number;
| Parameter | Type | Description |
| --- | --- | --- |
| val | <code>unknown</code> | |
| val | unknown | |
<b>Returns:</b>
`number`
number

View File

@ -16,10 +16,10 @@ export declare function defaultWhen<TVal>(condition: boolean, ...items: Array<TV
| Parameter | Type | Description |
| --- | --- | --- |
| condition | <code>boolean</code> | |
| items | <code>Array&lt;TVal&gt;</code> | |
| condition | boolean | |
| items | Array&lt;TVal&gt; | |
<b>Returns:</b>
`TVal`
TVal

View File

@ -16,10 +16,10 @@ export declare function defer<T = undefined>(ms: number, val?: T): Promise<T>;
| Parameter | Type | Description |
| --- | --- | --- |
| ms | <code>number</code> | |
| val | <code>T</code> | |
| ms | number | |
| val | T | |
<b>Returns:</b>
`Promise<T>`
Promise&lt;T&gt;

View File

@ -16,9 +16,9 @@ export declare function doesExist<T>(val: Optional<T>): val is T;
| Parameter | Type | Description |
| --- | --- | --- |
| val | <code>Optional&lt;T&gt;</code> | |
| val | [Optional](./js-utils.optional.md)<!-- -->&lt;T&gt; | |
<b>Returns:</b>
`val is T`
val is T

View File

@ -16,10 +16,10 @@ export declare function encode(chunks: Array<Buffer>, encoding: string): string;
| Parameter | Type | Description |
| --- | --- | --- |
| chunks | <code>Array&lt;Buffer&gt;</code> | |
| encoding | <code>string</code> | |
| chunks | Array&lt;Buffer&gt; | |
| encoding | string | |
<b>Returns:</b>
`string`
string

View File

@ -14,9 +14,9 @@ export declare function ensureArray<T>(val: Optional<Array<T>>): Array<T>;
| Parameter | Type | Description |
| --- | --- | --- |
| val | <code>Optional&lt;Array&lt;T&gt;&gt;</code> | |
| val | [Optional](./js-utils.optional.md)<!-- -->&lt;Array&lt;T&gt;&gt; | |
<b>Returns:</b>
`Array<T>`
Array&lt;T&gt;

View File

@ -16,9 +16,9 @@ export declare function entriesOf<TVal>(map: Optional<MapLike<TVal>>): Array<[st
| Parameter | Type | Description |
| --- | --- | --- |
| map | <code>Optional&lt;MapLike&lt;TVal&gt;&gt;</code> | |
| map | [Optional](./js-utils.optional.md)<!-- -->&lt;[MapLike](./js-utils.maplike.md)<!-- -->&lt;TVal&gt;&gt; | |
<b>Returns:</b>
`Array<[string, TVal]>`
Array&lt;\[string, TVal\]&gt;

View File

@ -14,7 +14,7 @@ export interface ExternalModule
| Property | Type | Description |
| --- | --- | --- |
| [data](./js-utils.externalmodule.data.md) | <code>unknown</code> | |
| [export](./js-utils.externalmodule.export.md) | <code>string</code> | |
| [require](./js-utils.externalmodule.require.md) | <code>string</code> | |
| [data](./js-utils.externalmodule.data.md) | unknown | |
| [export](./js-utils.externalmodule.export.md) | string | |
| [require](./js-utils.externalmodule.require.md) | string | |

View File

@ -16,9 +16,9 @@ export declare function filterNil<TItem>(list: ArrayLike<Optional<TItem>>): Arra
| Parameter | Type | Description |
| --- | --- | --- |
| list | <code>ArrayLike&lt;Optional&lt;TItem&gt;&gt;</code> | |
| list | ArrayLike&lt;[Optional](./js-utils.optional.md)<!-- -->&lt;TItem&gt;&gt; | |
<b>Returns:</b>
`Array<TItem>`
Array&lt;TItem&gt;

View File

@ -16,9 +16,9 @@ export declare function getConstructor(val: object): Function;
| Parameter | Type | Description |
| --- | --- | --- |
| val | <code>object</code> | |
| val | object | |
<b>Returns:</b>
`Function`
Function

View File

@ -16,10 +16,10 @@ export declare function getHead<TKey, TVal>(map: Map<TKey, Array<TVal>>, key: TK
| Parameter | Type | Description |
| --- | --- | --- |
| map | <code>Map&lt;TKey, Array&lt;TVal&gt;&gt;</code> | |
| key | <code>TKey</code> | |
| map | Map&lt;TKey, Array&lt;TVal&gt;&gt; | |
| key | TKey | |
<b>Returns:</b>
`TVal`
TVal

View File

@ -16,11 +16,11 @@ export declare function getHeadOrDefault<TKey, TVal>(map: Map<TKey, Array<Option
| Parameter | Type | Description |
| --- | --- | --- |
| map | <code>Map&lt;TKey, Array&lt;Optional&lt;TVal&gt;&gt;&gt;</code> | |
| key | <code>TKey</code> | |
| defaultValue | <code>TVal</code> | |
| map | Map&lt;TKey, Array&lt;[Optional](./js-utils.optional.md)<!-- -->&lt;TVal&gt;&gt;&gt; | |
| key | TKey | |
| defaultValue | TVal | |
<b>Returns:</b>
`TVal`
TVal

View File

@ -16,9 +16,9 @@ export declare function getMethods<TValue extends object>(value: TValue): Set<Fu
| Parameter | Type | Description |
| --- | --- | --- |
| value | <code>TValue</code> | |
| value | TValue | |
<b>Returns:</b>
`Set<Function>`
Set&lt;Function&gt;

View File

@ -16,11 +16,11 @@ export declare function getOrDefault<TKey, TVal>(map: Map<TKey, TVal>, key: TKey
| Parameter | Type | Description |
| --- | --- | --- |
| map | <code>Map&lt;TKey, TVal&gt;</code> | |
| key | <code>TKey</code> | |
| defaultValue | <code>TVal</code> | |
| map | Map&lt;TKey, TVal&gt; | |
| key | TKey | |
| defaultValue | TVal | |
<b>Returns:</b>
`TVal`
TVal

View File

@ -16,9 +16,9 @@ export declare function getTestLogger(verbose?: boolean): Logger;
| Parameter | Type | Description |
| --- | --- | --- |
| verbose | <code>boolean</code> | |
| verbose | boolean | |
<b>Returns:</b>
`Logger`
Logger

View File

@ -18,9 +18,9 @@ export declare function hasItems<T>(val: Optional<Array<T>>): val is Array<T>;
| Parameter | Type | Description |
| --- | --- | --- |
| val | <code>Optional&lt;Array&lt;T&gt;&gt;</code> | |
| val | [Optional](./js-utils.optional.md)<!-- -->&lt;Array&lt;T&gt;&gt; | |
<b>Returns:</b>
`val is Array<T>`
val is Array&lt;T&gt;

View File

@ -14,9 +14,9 @@ export declare function hasItems<T>(val: Optional<ReadonlyArray<T>>): val is Rea
| Parameter | Type | Description |
| --- | --- | --- |
| val | <code>Optional&lt;ReadonlyArray&lt;T&gt;&gt;</code> | |
| val | [Optional](./js-utils.optional.md)<!-- -->&lt;ReadonlyArray&lt;T&gt;&gt; | |
<b>Returns:</b>
`val is ReadonlyArray<T>`
val is ReadonlyArray&lt;T&gt;

View File

@ -16,6 +16,6 @@ constructor(msg?: string, ...nested: Array<Error>);
| Parameter | Type | Description |
| --- | --- | --- |
| msg | <code>string</code> | |
| nested | <code>Array&lt;Error&gt;</code> | |
| msg | string | |
| nested | Array&lt;Error&gt; | |

View File

@ -11,6 +11,7 @@ Error indicating that an invalid argument was passed to a function call.
```typescript
export declare class InvalidArgumentError extends BaseError
```
<b>Extends:</b> BaseError
## Constructors

View File

@ -15,5 +15,5 @@ export declare function isDebug(): boolean;
```
<b>Returns:</b>
`boolean`
boolean

View File

@ -16,9 +16,9 @@ export declare function isNil<T>(val: Optional<T>): val is Nil;
| Parameter | Type | Description |
| --- | --- | --- |
| val | <code>Optional&lt;T&gt;</code> | |
| val | [Optional](./js-utils.optional.md)<!-- -->&lt;T&gt; | |
<b>Returns:</b>
`val is Nil`
val is [Nil](./js-utils.nil.md)

View File

@ -14,11 +14,11 @@ export declare function leftPad(val: string, min?: number, fill?: string): strin
| Parameter | Type | Description |
| --- | --- | --- |
| val | <code>string</code> | |
| min | <code>number</code> | |
| fill | <code>string</code> | |
| val | string | |
| min | number | |
| fill | string | |
<b>Returns:</b>
`string`
string

View File

@ -16,9 +16,9 @@ export declare function makeDict<TVal>(map: Optional<MapLike<TVal>>): Dict<TVal>
| Parameter | Type | Description |
| --- | --- | --- |
| map | <code>Optional&lt;MapLike&lt;TVal&gt;&gt;</code> | |
| map | [Optional](./js-utils.optional.md)<!-- -->&lt;[MapLike](./js-utils.maplike.md)<!-- -->&lt;TVal&gt;&gt; | |
<b>Returns:</b>
`Dict<TVal>`
[Dict](./js-utils.dict.md)<!-- -->&lt;TVal&gt;

View File

@ -16,9 +16,9 @@ export declare function makeMap<TVal>(val: Optional<MapLike<TVal>>): Map<string,
| Parameter | Type | Description |
| --- | --- | --- |
| val | <code>Optional&lt;MapLike&lt;TVal&gt;&gt;</code> | |
| val | [Optional](./js-utils.optional.md)<!-- -->&lt;[MapLike](./js-utils.maplike.md)<!-- -->&lt;TVal&gt;&gt; | |
<b>Returns:</b>
`Map<string, TVal>`
Map&lt;string, TVal&gt;

View File

@ -16,9 +16,9 @@ export declare function mergeList<TItem>(...parts: Array<TItem | Array<TItem>>):
| Parameter | Type | Description |
| --- | --- | --- |
| parts | <code>Array&lt;TItem &#124; Array&lt;TItem&gt;&gt;</code> | |
| parts | Array&lt;TItem \| Array&lt;TItem&gt;&gt; | |
<b>Returns:</b>
`Array<TItem>`
Array&lt;TItem&gt;

View File

@ -16,10 +16,10 @@ export declare function mergeMap<TKey, TVal>(target: Map<TKey, TVal>, source: Ma
| Parameter | Type | Description |
| --- | --- | --- |
| target | <code>Map&lt;TKey, TVal&gt;</code> | |
| source | <code>Map&lt;TKey, TVal&gt; &#124; Array&lt;[TKey, TVal]&gt;</code> | |
| target | Map&lt;TKey, TVal&gt; | |
| source | Map&lt;TKey, TVal&gt; \| Array&lt;\[TKey, TVal\]&gt; | |
<b>Returns:</b>
`Map<TKey, TVal>`
Map&lt;TKey, TVal&gt;

View File

@ -16,6 +16,6 @@ constructor(msg?: string, ...nested: Array<Error>);
| Parameter | Type | Description |
| --- | --- | --- |
| msg | <code>string</code> | |
| nested | <code>Array&lt;Error&gt;</code> | |
| msg | string | |
| nested | Array&lt;Error&gt; | |

View File

@ -11,6 +11,7 @@ Error indicating that a required key did not exist in a map-like.
```typescript
export declare class MissingKeyError extends NotFoundError
```
<b>Extends:</b> [NotFoundError](./js-utils.notfounderror.md)
## Constructors

View File

@ -18,9 +18,9 @@ export declare function mustCoalesce<T>(...values: Array<Optional<T>>): T;
| Parameter | Type | Description |
| --- | --- | --- |
| values | <code>Array&lt;Optional&lt;T&gt;&gt;</code> | |
| values | Array&lt;[Optional](./js-utils.optional.md)<!-- -->&lt;T&gt;&gt; | |
<b>Returns:</b>
`T`
T

View File

@ -16,11 +16,11 @@ export declare function mustExist<T>(val: Optional<T>): T;
| Parameter | Type | Description |
| --- | --- | --- |
| val | <code>Optional&lt;T&gt;</code> | |
| val | [Optional](./js-utils.optional.md)<!-- -->&lt;T&gt; | |
<b>Returns:</b>
`T`
T
val

View File

@ -16,10 +16,10 @@ export declare function mustFind<TVal>(list: Array<Optional<TVal>>, predicate: P
| Parameter | Type | Description |
| --- | --- | --- |
| list | <code>Array&lt;Optional&lt;TVal&gt;&gt;</code> | |
| predicate | <code>PredicateC1&lt;TVal&gt;</code> | |
| list | Array&lt;[Optional](./js-utils.optional.md)<!-- -->&lt;TVal&gt;&gt; | |
| predicate | PredicateC1&lt;TVal&gt; | |
<b>Returns:</b>
`TVal`
TVal

View File

@ -16,10 +16,10 @@ export declare function mustGet<TKey, TVal>(map: Map<TKey, TVal>, key: TKey): TV
| Parameter | Type | Description |
| --- | --- | --- |
| map | <code>Map&lt;TKey, TVal&gt;</code> | |
| key | <code>TKey</code> | |
| map | Map&lt;TKey, TVal&gt; | |
| key | TKey | |
<b>Returns:</b>
`TVal`
TVal

View File

@ -19,9 +19,9 @@ export declare function normalizeMap(map: MapLike<unknown>): Dict<Array<string>>
| Parameter | Type | Description |
| --- | --- | --- |
| map | <code>MapLike&lt;unknown&gt;</code> | |
| map | [MapLike](./js-utils.maplike.md)<!-- -->&lt;unknown&gt; | |
<b>Returns:</b>
`Dict<Array<string>>`
[Dict](./js-utils.dict.md)<!-- -->&lt;Array&lt;string&gt;&gt;

View File

@ -16,6 +16,6 @@ constructor(msg?: string, ...nested: Array<Error>);
| Parameter | Type | Description |
| --- | --- | --- |
| msg | <code>string</code> | |
| nested | <code>Array&lt;Error&gt;</code> | |
| msg | string | |
| nested | Array&lt;Error&gt; | |

View File

@ -11,6 +11,7 @@ Error indicating that some value was not found.
```typescript
export declare class NotFoundError extends BaseError
```
<b>Extends:</b> BaseError
## Constructors

View File

@ -16,6 +16,6 @@ constructor(msg?: string, ...nested: Array<Error>);
| Parameter | Type | Description |
| --- | --- | --- |
| msg | <code>string</code> | |
| nested | <code>Array&lt;Error&gt;</code> | |
| msg | string | |
| nested | Array&lt;Error&gt; | |

View File

@ -11,6 +11,7 @@ Error indicating that a function has not been implemented yet.
```typescript
export declare class NotImplementedError extends BaseError
```
<b>Extends:</b> BaseError
## Constructors

View File

@ -16,9 +16,9 @@ export declare function pairsToMap<TVal>(pairs: Array<NameValuePair<TVal>>): Map
| Parameter | Type | Description |
| --- | --- | --- |
| pairs | <code>Array&lt;NameValuePair&lt;TVal&gt;&gt;</code> | |
| pairs | Array&lt;NameValuePair&lt;TVal&gt;&gt; | |
<b>Returns:</b>
`Map<string, TVal>`
Map&lt;string, TVal&gt;

View File

@ -16,9 +16,9 @@ export declare function pushMergeMap<TKey, TVal>(...args: Array<Map<TKey, TVal |
| Parameter | Type | Description |
| --- | --- | --- |
| args | <code>Array&lt;Map&lt;TKey, TVal &#124; Array&lt;TVal&gt;&gt;&gt;</code> | |
| args | Array&lt;Map&lt;TKey, TVal \| Array&lt;TVal&gt;&gt;&gt; | |
<b>Returns:</b>
`Map<TKey, Array<TVal>>`
Map&lt;TKey, Array&lt;TVal&gt;&gt;

View File

@ -16,9 +16,9 @@ export declare function removePid(path: string): Promise<void>;
| Parameter | Type | Description |
| --- | --- | --- |
| path | <code>string</code> | |
| path | string | |
<b>Returns:</b>
`Promise<void>`
Promise&lt;void&gt;

View File

@ -16,11 +16,11 @@ export declare function setOrPush<TKey, TVal>(map: Map<TKey, Array<TVal>>, key:
| Parameter | Type | Description |
| --- | --- | --- |
| map | <code>Map&lt;TKey, Array&lt;TVal&gt;&gt;</code> | The destination map and source of existing values. |
| key | <code>TKey</code> | The key to get and set. |
| val | <code>TVal &#124; Array&lt;TVal&gt;</code> | The value to add. |
| map | Map&lt;TKey, Array&lt;TVal&gt;&gt; | The destination map and source of existing values. |
| key | TKey | The key to get and set. |
| val | TVal \| Array&lt;TVal&gt; | The value to add. |
<b>Returns:</b>
`void`
void

View File

@ -14,9 +14,9 @@ export declare function signal(...signals: Array<NodeJS.Signals>): Promise<NodeJ
| Parameter | Type | Description |
| --- | --- | --- |
| signals | <code>Array&lt;NodeJS.Signals&gt;</code> | |
| signals | Array&lt;NodeJS.Signals&gt; | |
<b>Returns:</b>
`Promise<NodeJS.Signals>`
Promise&lt;NodeJS.Signals&gt;

View File

@ -16,9 +16,9 @@ export declare function spyLogger(spies: Partial<Logger>): Logger;
| Parameter | Type | Description |
| --- | --- | --- |
| spies | <code>Partial&lt;Logger&gt;</code> | |
| spies | Partial&lt;Logger&gt; | |
<b>Returns:</b>
`Logger`
Logger

View File

@ -16,10 +16,10 @@ export declare function timeout<T>(ms: number, oper: Promise<T>): Promise<T>;
| Parameter | Type | Description |
| --- | --- | --- |
| ms | <code>number</code> | |
| oper | <code>Promise&lt;T&gt;</code> | |
| ms | number | |
| oper | Promise&lt;T&gt; | |
<b>Returns:</b>
`Promise<T>`
Promise&lt;T&gt;

View File

@ -16,6 +16,6 @@ constructor(msg?: string, ...nested: Array<Error>);
| Parameter | Type | Description |
| --- | --- | --- |
| msg | <code>string</code> | |
| nested | <code>Array&lt;Error&gt;</code> | |
| msg | string | |
| nested | Array&lt;Error&gt; | |

View File

@ -11,6 +11,7 @@ Error indicating that a promise timed out.
```typescript
export declare class TimeoutError extends BaseError
```
<b>Extends:</b> BaseError
## Constructors

View File

@ -14,11 +14,11 @@ export declare function trim(val: string, max: number, tail?: string): string;
| Parameter | Type | Description |
| --- | --- | --- |
| val | <code>string</code> | |
| max | <code>number</code> | |
| tail | <code>string</code> | |
| val | string | |
| max | number | |
| tail | string | |
<b>Returns:</b>
`string`
string

View File

@ -16,9 +16,9 @@ export declare function waitForChild(child: ChildStreams): Promise<ChildResult>;
| Parameter | Type | Description |
| --- | --- | --- |
| child | <code>ChildStreams</code> | |
| child | ChildStreams | |
<b>Returns:</b>
`Promise<ChildResult>`
Promise&lt;[ChildResult](./js-utils.childresult.md)<!-- -->&gt;

View File

@ -16,9 +16,9 @@ export declare function writePid(path: string): Promise<void>;
| Parameter | Type | Description |
| --- | --- | --- |
| path | <code>string</code> | |
| path | string | |
<b>Returns:</b>
`Promise<void>`
Promise&lt;void&gt;

View File

@ -14,10 +14,10 @@ export declare function writeValue(stream: Writable, value: string): Promise<boo
| Parameter | Type | Description |
| --- | --- | --- |
| stream | <code>Writable</code> | |
| value | <code>string</code> | |
| stream | Writable | |
| value | string | |
<b>Returns:</b>
`Promise<boolean>`
Promise&lt;boolean&gt;

View File

@ -44,6 +44,7 @@
"eslint-plugin-mocha": "7.0.1",
"eslint-plugin-no-null": "1.0.2",
"eslint-plugin-sonarjs": "0.5.0",
"esm": "^3.2.25",
"lodash": "4.17.15",
"mocha": "8.0.1",
"mock-fs": "4.12.0",
@ -54,11 +55,14 @@
"rollup-plugin-eslint": "7.0.0",
"rollup-plugin-json": "4.0.0",
"rollup-plugin-multi-entry": "2.1.0",
"rollup-plugin-node-builtins": "^2.1.2",
"rollup-plugin-node-externals": "2.2.0",
"rollup-plugin-node-globals": "^1.4.0",
"rollup-plugin-node-resolve": "5.2.0",
"rollup-plugin-replace": "2.2.0",
"rollup-plugin-tslint": "0.2.2",
"rollup-plugin-typescript2": "0.27.1",
"rollup-plugin-visualizer": "^4.0.4",
"rollup-plugin-yaml": "2.0.0",
"sinon": "9.0.2",
"sinon-chai": "3.5.0",

714
yarn.lock

File diff suppressed because it is too large Load Diff