feat: add checklist
This commit is contained in:
parent
e530a99c31
commit
9c9a35c829
|
@ -0,0 +1,20 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ArrayMapperOptions](./js-utils.arraymapperoptions.md)
|
||||||
|
|
||||||
|
## ArrayMapperOptions interface
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export interface ArrayMapperOptions
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Property | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| [rest](./js-utils.arraymapperoptions.rest.md) | <code>string</code> | |
|
||||||
|
| [skip](./js-utils.arraymapperoptions.skip.md) | <code>number</code> | |
|
||||||
|
| [take](./js-utils.arraymapperoptions.take.md) | <code>Array<string></code> | |
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ArrayMapperOptions](./js-utils.arraymapperoptions.md) > [rest](./js-utils.arraymapperoptions.rest.md)
|
||||||
|
|
||||||
|
## ArrayMapperOptions.rest property
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
rest: string;
|
||||||
|
```
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ArrayMapperOptions](./js-utils.arraymapperoptions.md) > [skip](./js-utils.arraymapperoptions.skip.md)
|
||||||
|
|
||||||
|
## ArrayMapperOptions.skip property
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
skip: number;
|
||||||
|
```
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ArrayMapperOptions](./js-utils.arraymapperoptions.md) > [take](./js-utils.arraymapperoptions.take.md)
|
||||||
|
|
||||||
|
## ArrayMapperOptions.take property
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
take: Array<string>;
|
||||||
|
```
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ChildOptions](./js-utils.childoptions.md) > [args](./js-utils.childoptions.args.md)
|
||||||
|
|
||||||
|
## ChildOptions.args property
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
args: Array<string>;
|
||||||
|
```
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ChildOptions](./js-utils.childoptions.md) > [command](./js-utils.childoptions.command.md)
|
||||||
|
|
||||||
|
## ChildOptions.command property
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
command: string;
|
||||||
|
```
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ChildOptions](./js-utils.childoptions.md) > [cwd](./js-utils.childoptions.cwd.md)
|
||||||
|
|
||||||
|
## ChildOptions.cwd property
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
cwd: string;
|
||||||
|
```
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ChildOptions](./js-utils.childoptions.md) > [env](./js-utils.childoptions.env.md)
|
||||||
|
|
||||||
|
## ChildOptions.env property
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
env: Array<NameValuePair<string>>;
|
||||||
|
```
|
|
@ -0,0 +1,22 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ChildOptions](./js-utils.childoptions.md)
|
||||||
|
|
||||||
|
## ChildOptions interface
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export interface ChildOptions
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| Property | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| [args](./js-utils.childoptions.args.md) | <code>Array<string></code> | |
|
||||||
|
| [command](./js-utils.childoptions.command.md) | <code>string</code> | |
|
||||||
|
| [cwd](./js-utils.childoptions.cwd.md) | <code>string</code> | |
|
||||||
|
| [env](./js-utils.childoptions.env.md) | <code>Array<NameValuePair<string>></code> | |
|
||||||
|
| [timeout](./js-utils.childoptions.timeout.md) | <code>number</code> | |
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ChildOptions](./js-utils.childoptions.md) > [timeout](./js-utils.childoptions.timeout.md)
|
||||||
|
|
||||||
|
## ChildOptions.timeout property
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
timeout: number;
|
||||||
|
```
|
|
@ -0,0 +1,20 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ChildResult](./js-utils.childresult.md)
|
||||||
|
|
||||||
|
## ChildResult interface
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export interface ChildResult
|
||||||
|
```
|
||||||
|
|
||||||
|
## Properties
|
||||||
|
|
||||||
|
| 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> | |
|
||||||
|
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ChildResult](./js-utils.childresult.md) > [status](./js-utils.childresult.status.md)
|
||||||
|
|
||||||
|
## ChildResult.status property
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
status: number;
|
||||||
|
```
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ChildResult](./js-utils.childresult.md) > [stderr](./js-utils.childresult.stderr.md)
|
||||||
|
|
||||||
|
## ChildResult.stderr property
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
stderr: string;
|
||||||
|
```
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ChildResult](./js-utils.childresult.md) > [stdout](./js-utils.childresult.stdout.md)
|
||||||
|
|
||||||
|
## ChildResult.stdout property
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
stdout: string;
|
||||||
|
```
|
|
@ -0,0 +1,11 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [ChildSpawner](./js-utils.childspawner.md)
|
||||||
|
|
||||||
|
## ChildSpawner type
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export declare type ChildSpawner = typeof spawn;
|
||||||
|
```
|
|
@ -0,0 +1,22 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [constructorName](./js-utils.constructorname.md)
|
||||||
|
|
||||||
|
## constructorName() function
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export declare function constructorName(val: object): string;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| val | <code>object</code> | |
|
||||||
|
|
||||||
|
<b>Returns:</b>
|
||||||
|
|
||||||
|
`string`
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [getConstructor](./js-utils.getconstructor.md)
|
||||||
|
|
||||||
|
## getConstructor() function
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export declare function getConstructor(val: object): Function;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| val | <code>object</code> | |
|
||||||
|
|
||||||
|
<b>Returns:</b>
|
||||||
|
|
||||||
|
`Function`
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [getHead](./js-utils.gethead.md)
|
||||||
|
|
||||||
|
## getHead() function
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export declare function getHead<TKey, TVal>(map: Map<TKey, Array<TVal>>, key: TKey): TVal;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| map | <code>Map<TKey, Array<TVal>></code> | |
|
||||||
|
| key | <code>TKey</code> | |
|
||||||
|
|
||||||
|
<b>Returns:</b>
|
||||||
|
|
||||||
|
`TVal`
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [getHeadOrDefault](./js-utils.getheadordefault.md)
|
||||||
|
|
||||||
|
## getHeadOrDefault() function
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export declare function getHeadOrDefault<TKey, TVal>(map: Map<TKey, Array<Optional<TVal>>>, key: TKey, defaultValue: TVal): TVal;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| map | <code>Map<TKey, Array<Optional<TVal>>></code> | |
|
||||||
|
| key | <code>TKey</code> | |
|
||||||
|
| defaultValue | <code>TVal</code> | |
|
||||||
|
|
||||||
|
<b>Returns:</b>
|
||||||
|
|
||||||
|
`TVal`
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [getMethods](./js-utils.getmethods.md)
|
||||||
|
|
||||||
|
## getMethods() function
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export declare function getMethods<TValue extends object>(value: TValue): Set<Function>;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| value | <code>TValue</code> | |
|
||||||
|
|
||||||
|
<b>Returns:</b>
|
||||||
|
|
||||||
|
`Set<Function>`
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [getOrDefault](./js-utils.getordefault.md)
|
||||||
|
|
||||||
|
## getOrDefault() function
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export declare function getOrDefault<TKey, TVal>(map: Map<TKey, TVal>, key: TKey, defaultValue: TVal): TVal;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| map | <code>Map<TKey, TVal></code> | |
|
||||||
|
| key | <code>TKey</code> | |
|
||||||
|
| defaultValue | <code>TVal</code> | |
|
||||||
|
|
||||||
|
<b>Returns:</b>
|
||||||
|
|
||||||
|
`TVal`
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [leftPad](./js-utils.leftpad.md)
|
||||||
|
|
||||||
|
## leftPad() function
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export declare function leftPad(val: string, min?: number, fill?: string): string;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| val | <code>string</code> | |
|
||||||
|
| min | <code>number</code> | |
|
||||||
|
| fill | <code>string</code> | |
|
||||||
|
|
||||||
|
<b>Returns:</b>
|
||||||
|
|
||||||
|
`string`
|
||||||
|
|
|
@ -22,6 +22,7 @@
|
||||||
| Function | Description |
|
| Function | Description |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
| [concat(chunks)](./js-utils.concat.md) | |
|
| [concat(chunks)](./js-utils.concat.md) | |
|
||||||
|
| [constructorName(val)](./js-utils.constructorname.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. |
|
| [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) | |
|
| [defaultWhen(condition, items)](./js-utils.defaultwhen.md) | |
|
||||||
| [defer(ms, val)](./js-utils.defer.md) | Resolve after a set amount of time. |
|
| [defer(ms, val)](./js-utils.defer.md) | Resolve after a set amount of time. |
|
||||||
|
@ -29,9 +30,15 @@
|
||||||
| [encode(chunks, encoding)](./js-utils.encode.md) | |
|
| [encode(chunks, encoding)](./js-utils.encode.md) | |
|
||||||
| [entriesOf(map)](./js-utils.entriesof.md) | |
|
| [entriesOf(map)](./js-utils.entriesof.md) | |
|
||||||
| [filterNil(list)](./js-utils.filternil.md) | Remove any null or undefined items from the list. |
|
| [filterNil(list)](./js-utils.filternil.md) | Remove any null or undefined items from the list. |
|
||||||
|
| [getConstructor(val)](./js-utils.getconstructor.md) | |
|
||||||
|
| [getHead(map, key)](./js-utils.gethead.md) | |
|
||||||
|
| [getHeadOrDefault(map, key, defaultValue)](./js-utils.getheadordefault.md) | |
|
||||||
|
| [getMethods(value)](./js-utils.getmethods.md) | |
|
||||||
|
| [getOrDefault(map, key, defaultValue)](./js-utils.getordefault.md) | |
|
||||||
| [getTestLogger(verbose)](./js-utils.gettestlogger.md) | |
|
| [getTestLogger(verbose)](./js-utils.gettestlogger.md) | |
|
||||||
| [isDebug()](./js-utils.isdebug.md) | |
|
| [isDebug()](./js-utils.isdebug.md) | |
|
||||||
| [isNil(val)](./js-utils.isnil.md) | |
|
| [isNil(val)](./js-utils.isnil.md) | |
|
||||||
|
| [leftPad(val, min, fill)](./js-utils.leftpad.md) | |
|
||||||
| [makeDict(map)](./js-utils.makedict.md) | Turns a map or dict into a dict |
|
| [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. |
|
| [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. |
|
| [mergeList(parts)](./js-utils.mergelist.md) | Merge arguments, which may or may not be arrays, into one return that is definitely an array. |
|
||||||
|
@ -40,19 +47,26 @@
|
||||||
| [mustExist(val)](./js-utils.mustexist.md) | Assert that a variable is not nil and return the value. |
|
| [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. |
|
| [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. |
|
| [mustGet(map, key)](./js-utils.mustget.md) | Get an element from a Map and guard against nil values. |
|
||||||
|
| [normalizeMap(map)](./js-utils.normalizemap.md) | |
|
||||||
|
| [pairsToMap(pairs)](./js-utils.pairstomap.md) | |
|
||||||
| [pushMergeMap(args)](./js-utils.pushmergemap.md) | |
|
| [pushMergeMap(args)](./js-utils.pushmergemap.md) | |
|
||||||
| [removePid(path)](./js-utils.removepid.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. |
|
| [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) | |
|
| [signal(signals)](./js-utils.signal.md) | |
|
||||||
| [spyLogger(spies)](./js-utils.spylogger.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. |
|
| [timeout(ms, oper)](./js-utils.timeout.md) | Reject after a set amount of time if the original promise has not yet resolved. |
|
||||||
|
| [trim(val, max, tail)](./js-utils.trim.md) | |
|
||||||
| [waitForChild(child)](./js-utils.waitforchild.md) | |
|
| [waitForChild(child)](./js-utils.waitforchild.md) | |
|
||||||
| [writePid(path)](./js-utils.writepid.md) | |
|
| [writePid(path)](./js-utils.writepid.md) | |
|
||||||
|
| [writeValue(stream, value)](./js-utils.writevalue.md) | |
|
||||||
|
|
||||||
## Interfaces
|
## Interfaces
|
||||||
|
|
||||||
| Interface | Description |
|
| Interface | Description |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
|
| [ArrayMapperOptions](./js-utils.arraymapperoptions.md) | |
|
||||||
|
| [ChildOptions](./js-utils.childoptions.md) | |
|
||||||
|
| [ChildResult](./js-utils.childresult.md) | |
|
||||||
| [Dict](./js-utils.dict.md) | |
|
| [Dict](./js-utils.dict.md) | |
|
||||||
| [ExternalModule](./js-utils.externalmodule.md) | |
|
| [ExternalModule](./js-utils.externalmodule.md) | |
|
||||||
|
|
||||||
|
@ -68,6 +82,7 @@
|
||||||
|
|
||||||
| Type Alias | Description |
|
| Type Alias | Description |
|
||||||
| --- | --- |
|
| --- | --- |
|
||||||
|
| [ChildSpawner](./js-utils.childspawner.md) | |
|
||||||
| [MapLike](./js-utils.maplike.md) | A <code>Map</code> or dictionary object with string keys and <code>TVal</code> values. |
|
| [MapLike](./js-utils.maplike.md) | A <code>Map</code> or dictionary object with string keys and <code>TVal</code> values. |
|
||||||
| [ModuleCtor](./js-utils.modulector.md) | |
|
| [ModuleCtor](./js-utils.modulector.md) | |
|
||||||
| [Nil](./js-utils.nil.md) | Unset value. |
|
| [Nil](./js-utils.nil.md) | Unset value. |
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [normalizeMap](./js-utils.normalizemap.md)
|
||||||
|
|
||||||
|
## normalizeMap() function
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export declare function normalizeMap(map: MapLike<unknown>): Dict<Array<string>>;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| map | <code>MapLike<unknown></code> | |
|
||||||
|
|
||||||
|
<b>Returns:</b>
|
||||||
|
|
||||||
|
`Dict<Array<string>>`
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [pairsToMap](./js-utils.pairstomap.md)
|
||||||
|
|
||||||
|
## pairsToMap() function
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export declare function pairsToMap<TVal>(pairs: Array<NameValuePair<TVal>>): Map<string, TVal>;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| pairs | <code>Array<NameValuePair<TVal>></code> | |
|
||||||
|
|
||||||
|
<b>Returns:</b>
|
||||||
|
|
||||||
|
`Map<string, TVal>`
|
||||||
|
|
|
@ -0,0 +1,24 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [trim](./js-utils.trim.md)
|
||||||
|
|
||||||
|
## trim() function
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export declare function trim(val: string, max: number, tail?: string): string;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| val | <code>string</code> | |
|
||||||
|
| max | <code>number</code> | |
|
||||||
|
| tail | <code>string</code> | |
|
||||||
|
|
||||||
|
<b>Returns:</b>
|
||||||
|
|
||||||
|
`string`
|
||||||
|
|
|
@ -0,0 +1,23 @@
|
||||||
|
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
||||||
|
|
||||||
|
[Home](./index.md) > [@apextoaster/js-utils](./js-utils.md) > [writeValue](./js-utils.writevalue.md)
|
||||||
|
|
||||||
|
## writeValue() function
|
||||||
|
|
||||||
|
<b>Signature:</b>
|
||||||
|
|
||||||
|
```typescript
|
||||||
|
export declare function writeValue(stream: Writable, value: string): Promise<boolean>;
|
||||||
|
```
|
||||||
|
|
||||||
|
## Parameters
|
||||||
|
|
||||||
|
| Parameter | Type | Description |
|
||||||
|
| --- | --- | --- |
|
||||||
|
| stream | <code>Writable</code> | |
|
||||||
|
| value | <code>string</code> | |
|
||||||
|
|
||||||
|
<b>Returns:</b>
|
||||||
|
|
||||||
|
`Promise<boolean>`
|
||||||
|
|
24
src/index.ts
24
src/index.ts
|
@ -28,6 +28,7 @@ export {
|
||||||
} from './utils';
|
} from './utils';
|
||||||
export {
|
export {
|
||||||
ArrayMapper,
|
ArrayMapper,
|
||||||
|
ArrayMapperOptions,
|
||||||
} from './utils/ArrayMapper';
|
} from './utils/ArrayMapper';
|
||||||
export {
|
export {
|
||||||
defer,
|
defer,
|
||||||
|
@ -37,17 +38,33 @@ export {
|
||||||
concat,
|
concat,
|
||||||
encode,
|
encode,
|
||||||
} from './utils/Buffer';
|
} from './utils/Buffer';
|
||||||
export { waitForChild } from './utils/Child';
|
export {
|
||||||
|
Checklist,
|
||||||
|
ChecklistMode,
|
||||||
|
ChecklistOptions,
|
||||||
|
} from './utils/Checklist';
|
||||||
|
export {
|
||||||
|
ChildOptions,
|
||||||
|
ChildResult,
|
||||||
|
ChildSpawner,
|
||||||
|
waitForChild,
|
||||||
|
writeValue,
|
||||||
|
} from './utils/Child';
|
||||||
export { ExternalModule, ModuleCtor } from './utils/ExternalModule';
|
export { ExternalModule, ModuleCtor } from './utils/ExternalModule';
|
||||||
export { isDebug } from './utils/Env';
|
export { isDebug } from './utils/Env';
|
||||||
export {
|
export {
|
||||||
Dict,
|
Dict,
|
||||||
MapLike,
|
MapLike,
|
||||||
entriesOf,
|
entriesOf,
|
||||||
|
getHead,
|
||||||
|
getHeadOrDefault,
|
||||||
|
getOrDefault,
|
||||||
makeDict,
|
makeDict,
|
||||||
makeMap,
|
makeMap,
|
||||||
mergeMap,
|
mergeMap,
|
||||||
mustGet,
|
mustGet,
|
||||||
|
normalizeMap,
|
||||||
|
pairsToMap,
|
||||||
pushMergeMap,
|
pushMergeMap,
|
||||||
setOrPush,
|
setOrPush,
|
||||||
} from './utils/Map';
|
} from './utils/Map';
|
||||||
|
@ -56,6 +73,7 @@ export {
|
||||||
writePid,
|
writePid,
|
||||||
} from './utils/PidFile';
|
} from './utils/PidFile';
|
||||||
export {
|
export {
|
||||||
|
constructorName,
|
||||||
getConstructor,
|
getConstructor,
|
||||||
getMethods,
|
getMethods,
|
||||||
} from './utils/Reflect';
|
} from './utils/Reflect';
|
||||||
|
@ -65,3 +83,7 @@ export {
|
||||||
SIGNAL_STOP,
|
SIGNAL_STOP,
|
||||||
signal,
|
signal,
|
||||||
} from './utils/Signal';
|
} from './utils/Signal';
|
||||||
|
export {
|
||||||
|
leftPad,
|
||||||
|
trim,
|
||||||
|
} from './utils/String';
|
||||||
|
|
|
@ -0,0 +1,31 @@
|
||||||
|
export enum ChecklistMode {
|
||||||
|
INCLUDE = 'include',
|
||||||
|
EXCLUDE = 'exclude',
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ChecklistOptions<T> {
|
||||||
|
data: Array<T>;
|
||||||
|
mode: ChecklistMode;
|
||||||
|
}
|
||||||
|
|
||||||
|
export class Checklist<T> implements ChecklistOptions<T> {
|
||||||
|
public readonly data: Array<T>;
|
||||||
|
public readonly mode: ChecklistMode;
|
||||||
|
|
||||||
|
constructor(options: ChecklistOptions<T>) {
|
||||||
|
this.data = Array.from(options.data);
|
||||||
|
this.mode = options.mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
public check(value: T): boolean {
|
||||||
|
if (this.mode === ChecklistMode.INCLUDE) {
|
||||||
|
return this.data.includes(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (this.mode === ChecklistMode.EXCLUDE) {
|
||||||
|
return !this.data.includes(value);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
}
|
Loading…
Reference in New Issue