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: test-cover
test-check: ## run mocha unit tests with coverage reports 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: ## run mocha unit tests with coverage reports
test-cover: test-check test-cover: test-check

View File

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

View File

@ -16,5 +16,5 @@ constructor(options: ArrayMapperOptions);
| Parameter | Type | Description | | 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 | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| input | <code>Array&lt;string&gt;</code> | | | input | Array&lt;string&gt; | |
<b>Returns:</b> <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 | | Property | Modifiers | Type | Description |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| [rest](./js-utils.arraymapper.rest.md) | | <code>string</code> | | | [rest](./js-utils.arraymapper.rest.md) | | string | |
| [skip](./js-utils.arraymapper.skip.md) | | <code>number</code> | | | [skip](./js-utils.arraymapper.skip.md) | | number | |
| [take](./js-utils.arraymapper.take.md) | | <code>Array&lt;string&gt;</code> | | | [take](./js-utils.arraymapper.take.md) | | Array&lt;string&gt; | |
## Methods ## Methods

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -16,5 +16,5 @@ constructor(options: ChecklistOptions<T>);
| Parameter | Type | Description | | 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 | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| value | <code>T</code> | | | value | T | |
<b>Returns:</b> <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 ```typescript
export declare class Checklist<T> implements ChecklistOptions<T> export declare class Checklist<T> implements ChecklistOptions<T>
``` ```
<b>Implements:</b> [ChecklistOptions](./js-utils.checklistoptions.md)<!-- -->&lt;T&gt;
## Constructors ## Constructors
@ -22,8 +23,8 @@ export declare class Checklist<T> implements ChecklistOptions<T>
| Property | Modifiers | Type | Description | | Property | Modifiers | Type | Description |
| --- | --- | --- | --- | | --- | --- | --- | --- |
| [data](./js-utils.checklist.data.md) | | <code>Array&lt;T&gt;</code> | TODO: switch to Set | | [data](./js-utils.checklist.data.md) | | Array&lt;T&gt; | TODO: switch to Set |
| [mode](./js-utils.checklist.mode.md) | | <code>ChecklistMode</code> | | | [mode](./js-utils.checklist.mode.md) | | [ChecklistMode](./js-utils.checklistmode.md) | |
## Methods ## Methods

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -16,10 +16,10 @@ export declare function defaultWhen<TVal>(condition: boolean, ...items: Array<TV
| Parameter | Type | Description | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| condition | <code>boolean</code> | | | condition | boolean | |
| items | <code>Array&lt;TVal&gt;</code> | | | items | Array&lt;TVal&gt; | |
<b>Returns:</b> <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 | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| ms | <code>number</code> | | | ms | number | |
| val | <code>T</code> | | | val | T | |
<b>Returns:</b> <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 | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| val | <code>Optional&lt;T&gt;</code> | | | val | [Optional](./js-utils.optional.md)<!-- -->&lt;T&gt; | |
<b>Returns:</b> <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 | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| chunks | <code>Array&lt;Buffer&gt;</code> | | | chunks | Array&lt;Buffer&gt; | |
| encoding | <code>string</code> | | | encoding | string | |
<b>Returns:</b> <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 | | 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> <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 | | 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> <b>Returns:</b>
`Array<[string, TVal]>` Array&lt;\[string, TVal\]&gt;

View File

@ -14,7 +14,7 @@ export interface ExternalModule
| Property | Type | Description | | Property | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| [data](./js-utils.externalmodule.data.md) | <code>unknown</code> | | | [data](./js-utils.externalmodule.data.md) | unknown | |
| [export](./js-utils.externalmodule.export.md) | <code>string</code> | | | [export](./js-utils.externalmodule.export.md) | string | |
| [require](./js-utils.externalmodule.require.md) | <code>string</code> | | | [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 | | 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> <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 | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| val | <code>object</code> | | | val | object | |
<b>Returns:</b> <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 | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| map | <code>Map&lt;TKey, Array&lt;TVal&gt;&gt;</code> | | | map | Map&lt;TKey, Array&lt;TVal&gt;&gt; | |
| key | <code>TKey</code> | | | key | TKey | |
<b>Returns:</b> <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 | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| map | <code>Map&lt;TKey, Array&lt;Optional&lt;TVal&gt;&gt;&gt;</code> | | | map | Map&lt;TKey, Array&lt;[Optional](./js-utils.optional.md)<!-- -->&lt;TVal&gt;&gt;&gt; | |
| key | <code>TKey</code> | | | key | TKey | |
| defaultValue | <code>TVal</code> | | | defaultValue | TVal | |
<b>Returns:</b> <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 | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| value | <code>TValue</code> | | | value | TValue | |
<b>Returns:</b> <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 | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| map | <code>Map&lt;TKey, TVal&gt;</code> | | | map | Map&lt;TKey, TVal&gt; | |
| key | <code>TKey</code> | | | key | TKey | |
| defaultValue | <code>TVal</code> | | | defaultValue | TVal | |
<b>Returns:</b> <b>Returns:</b>
`TVal` TVal

View File

@ -16,9 +16,9 @@ export declare function getTestLogger(verbose?: boolean): Logger;
| Parameter | Type | Description | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| verbose | <code>boolean</code> | | | verbose | boolean | |
<b>Returns:</b> <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 | | 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> <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 | | 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> <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 | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| msg | <code>string</code> | | | msg | string | |
| nested | <code>Array&lt;Error&gt;</code> | | | nested | Array&lt;Error&gt; | |

View File

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

View File

@ -15,5 +15,5 @@ export declare function isDebug(): boolean;
``` ```
<b>Returns:</b> <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 | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| val | <code>Optional&lt;T&gt;</code> | | | val | [Optional](./js-utils.optional.md)<!-- -->&lt;T&gt; | |
<b>Returns:</b> <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 | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| val | <code>string</code> | | | val | string | |
| min | <code>number</code> | | | min | number | |
| fill | <code>string</code> | | | fill | string | |
<b>Returns:</b> <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 | | 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> <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 | | 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> <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 | | 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> <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 | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| target | <code>Map&lt;TKey, TVal&gt;</code> | | | target | Map&lt;TKey, TVal&gt; | |
| source | <code>Map&lt;TKey, TVal&gt; &#124; Array&lt;[TKey, TVal]&gt;</code> | | | source | Map&lt;TKey, TVal&gt; \| Array&lt;\[TKey, TVal\]&gt; | |
<b>Returns:</b> <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 | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| msg | <code>string</code> | | | msg | string | |
| nested | <code>Array&lt;Error&gt;</code> | | | 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 ```typescript
export declare class MissingKeyError extends NotFoundError export declare class MissingKeyError extends NotFoundError
``` ```
<b>Extends:</b> [NotFoundError](./js-utils.notfounderror.md)
## Constructors ## Constructors

View File

@ -18,9 +18,9 @@ export declare function mustCoalesce<T>(...values: Array<Optional<T>>): T;
| Parameter | Type | Description | | 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> <b>Returns:</b>
`T` T

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

@ -16,9 +16,9 @@ export declare function pairsToMap<TVal>(pairs: Array<NameValuePair<TVal>>): Map
| Parameter | Type | Description | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| pairs | <code>Array&lt;NameValuePair&lt;TVal&gt;&gt;</code> | | | pairs | Array&lt;NameValuePair&lt;TVal&gt;&gt; | |
<b>Returns:</b> <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 | | 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> <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 | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| path | <code>string</code> | | | path | string | |
<b>Returns:</b> <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 | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| map | <code>Map&lt;TKey, Array&lt;TVal&gt;&gt;</code> | The destination map and source of existing values. | | map | Map&lt;TKey, Array&lt;TVal&gt;&gt; | The destination map and source of existing values. |
| key | <code>TKey</code> | The key to get and set. | | key | TKey | The key to get and set. |
| val | <code>TVal &#124; Array&lt;TVal&gt;</code> | The value to add. | | val | TVal \| Array&lt;TVal&gt; | The value to add. |
<b>Returns:</b> <b>Returns:</b>
`void` void

View File

@ -14,9 +14,9 @@ export declare function signal(...signals: Array<NodeJS.Signals>): Promise<NodeJ
| Parameter | Type | Description | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| signals | <code>Array&lt;NodeJS.Signals&gt;</code> | | | signals | Array&lt;NodeJS.Signals&gt; | |
<b>Returns:</b> <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 | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| spies | <code>Partial&lt;Logger&gt;</code> | | | spies | Partial&lt;Logger&gt; | |
<b>Returns:</b> <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 | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| ms | <code>number</code> | | | ms | number | |
| oper | <code>Promise&lt;T&gt;</code> | | | oper | Promise&lt;T&gt; | |
<b>Returns:</b> <b>Returns:</b>
`Promise<T>` Promise&lt;T&gt;

View File

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

View File

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

View File

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

View File

@ -16,9 +16,9 @@ export declare function waitForChild(child: ChildStreams): Promise<ChildResult>;
| Parameter | Type | Description | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| child | <code>ChildStreams</code> | | | child | ChildStreams | |
<b>Returns:</b> <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 | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| path | <code>string</code> | | | path | string | |
<b>Returns:</b> <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 | | Parameter | Type | Description |
| --- | --- | --- | | --- | --- | --- |
| stream | <code>Writable</code> | | | stream | Writable | |
| value | <code>string</code> | | | value | string | |
<b>Returns:</b> <b>Returns:</b>
`Promise<boolean>` Promise&lt;boolean&gt;

View File

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

714
yarn.lock

File diff suppressed because it is too large Load Diff