@isdk/util 0.3.4 → 0.3.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +111 -1
- package/dist/index.d.ts +111 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/classes/BinarySemaphore.md +27 -27
- package/docs/classes/ConfigFile.md +6 -6
- package/docs/classes/Deque.md +13 -13
- package/docs/classes/IntSet.md +14 -14
- package/docs/classes/Semaphore.md +26 -26
- package/docs/classes/SignalGate.md +9 -9
- package/docs/functions/RateLimit.md +3 -3
- package/docs/functions/arrayHasAll.md +1 -1
- package/docs/functions/extNameLevel.md +1 -1
- package/docs/functions/filenameReservedRegex.md +1 -1
- package/docs/functions/findPort.md +3 -3
- package/docs/functions/getMultiLevelExtname.md +3 -3
- package/docs/functions/glob.md +1 -1
- package/docs/functions/isStringIn.md +1 -1
- package/docs/functions/isValidFilename.md +1 -1
- package/docs/functions/isValidFilepath.md +1 -1
- package/docs/functions/normalizeIncludeFiles.md +1 -1
- package/docs/functions/omitDeepBy.md +125 -0
- package/docs/functions/omitEmptyDeep.md +51 -0
- package/docs/functions/parseFrontMatter.md +3 -3
- package/docs/functions/parseYaml.md +1 -1
- package/docs/functions/reControlCharsRegex.md +1 -1
- package/docs/functions/registerYamlTag.md +1 -1
- package/docs/functions/removeLeadingEmptyLines.md +1 -1
- package/docs/functions/sanitizeFilename.md +3 -3
- package/docs/functions/sanitizeFilepath.md +3 -3
- package/docs/functions/sleep.md +1 -1
- package/docs/functions/stringifyYaml.md +1 -1
- package/docs/functions/toCamelCase.md +1 -1
- package/docs/functions/toCapitalCase.md +1 -1
- package/docs/functions/toPascalCase.md +1 -1
- package/docs/functions/traverseFolder.md +1 -1
- package/docs/functions/traverseFolderSync.md +1 -1
- package/docs/functions/yieldExec.md +1 -1
- package/docs/globals.md +2 -0
- package/docs/interfaces/BinarySemaphoreAcquireOptions.md +2 -2
- package/docs/interfaces/BinarySemaphoreOptions.md +5 -5
- package/docs/interfaces/BinarySemaphoreReleaseOptions.md +2 -2
- package/docs/interfaces/BinarySemaphoreReleaserFunc.md +3 -3
- package/docs/interfaces/IncludeFiles.md +3 -3
- package/docs/interfaces/LoadConfigFileOptions.md +3 -3
- package/docs/interfaces/SanitizeFilenameOptions.md +3 -3
- package/docs/interfaces/SemaphoreOptions.md +7 -7
- package/docs/interfaces/SemaphoreTaskItem.md +5 -5
- package/docs/type-aliases/SemaphoreIsReadyFuncType.md +1 -1
- package/docs/type-aliases/StringifyFunc.md +1 -1
- package/docs/type-aliases/TraverseFolderHandler.md +1 -1
- package/docs/type-aliases/TraverseFolderSyncHandler.md +1 -1
- package/docs/variables/DefaultAllTextFiles.md +1 -1
- package/docs/variables/DefaultAsyncSemaphoreCapacity.md +1 -1
- package/docs/variables/FilenameReservedRegex.md +1 -1
- package/docs/variables/WindowsReservedNameRegex.md +1 -1
- package/package.json +7 -5
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: ConfigFile
|
|
8
8
|
|
|
9
|
-
Defined in: [src/config-file.ts:46](https://github.com/isdk/util.js/blob/
|
|
9
|
+
Defined in: [src/config-file.ts:46](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/config-file.ts#L46)
|
|
10
10
|
|
|
11
11
|
Represents a configuration file utility class that provides methods to load and save configuration files.
|
|
12
12
|
It supports multiple file formats such as YAML, JSON, etc., by registering corresponding parsers and stringifiers.
|
|
@@ -45,7 +45,7 @@ console.log(config); // Output: { key: 'value' }
|
|
|
45
45
|
|
|
46
46
|
> `static` **stringifys**: `Record`\<`string`, [`StringifyFunc`](../type-aliases/StringifyFunc.md)\> = `{}`
|
|
47
47
|
|
|
48
|
-
Defined in: [src/config-file.ts:50](https://github.com/isdk/util.js/blob/
|
|
48
|
+
Defined in: [src/config-file.ts:50](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/config-file.ts#L50)
|
|
49
49
|
|
|
50
50
|
A record of registered stringify functions for different file extensions.
|
|
51
51
|
|
|
@@ -55,7 +55,7 @@ A record of registered stringify functions for different file extensions.
|
|
|
55
55
|
|
|
56
56
|
> `static` **existsSync**(`filename`, `options?`): `boolean`
|
|
57
57
|
|
|
58
|
-
Defined in: [src/config-file.ts:132](https://github.com/isdk/util.js/blob/
|
|
58
|
+
Defined in: [src/config-file.ts:132](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/config-file.ts#L132)
|
|
59
59
|
|
|
60
60
|
Checks if a configuration file exists at the specified path.
|
|
61
61
|
|
|
@@ -104,7 +104,7 @@ console.log(existsWithExt); // true or false
|
|
|
104
104
|
|
|
105
105
|
> `static` **loadSync**(`filename`, `options?`): `any`
|
|
106
106
|
|
|
107
|
-
Defined in: [src/config-file.ts:85](https://github.com/isdk/util.js/blob/
|
|
107
|
+
Defined in: [src/config-file.ts:85](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/config-file.ts#L85)
|
|
108
108
|
|
|
109
109
|
Loads a configuration file based on the provided filename and options.
|
|
110
110
|
|
|
@@ -141,7 +141,7 @@ console.log(config); // Output: { key: 'value' }
|
|
|
141
141
|
|
|
142
142
|
> `static` **register**(`extname`, `parser`, `stringify`): `void`
|
|
143
143
|
|
|
144
|
-
Defined in: [src/config-file.ts:64](https://github.com/isdk/util.js/blob/
|
|
144
|
+
Defined in: [src/config-file.ts:64](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/config-file.ts#L64)
|
|
145
145
|
|
|
146
146
|
Registers a parser and stringifier for specific file extensions.
|
|
147
147
|
|
|
@@ -181,7 +181,7 @@ ConfigFile.register(['.json'], JSON.parse, (obj) => JSON.stringify(obj, null, 2)
|
|
|
181
181
|
|
|
182
182
|
> `static` **saveSync**(`filename`, `config`, `options?`): `string`
|
|
183
183
|
|
|
184
|
-
Defined in: [src/config-file.ts:102](https://github.com/isdk/util.js/blob/
|
|
184
|
+
Defined in: [src/config-file.ts:102](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/config-file.ts#L102)
|
|
185
185
|
|
|
186
186
|
Saves a configuration object to a file with the specified filename and options.
|
|
187
187
|
|
package/docs/classes/Deque.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: Deque\<T\>
|
|
8
8
|
|
|
9
|
-
Defined in: [src/deque.ts:31](https://github.com/isdk/util.js/blob/
|
|
9
|
+
Defined in: [src/deque.ts:31](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/deque.ts#L31)
|
|
10
10
|
|
|
11
11
|
## Extends
|
|
12
12
|
|
|
@@ -28,7 +28,7 @@ Defined in: [src/deque.ts:31](https://github.com/isdk/util.js/blob/1244ecc63e69d
|
|
|
28
28
|
|
|
29
29
|
> **new Deque**\<`T`\>(`capacity?`, `disableAutoResize?`): `Deque`\<`T`\>
|
|
30
30
|
|
|
31
|
-
Defined in: [src/deque.ts:37](https://github.com/isdk/util.js/blob/
|
|
31
|
+
Defined in: [src/deque.ts:37](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/deque.ts#L37)
|
|
32
32
|
|
|
33
33
|
#### Parameters
|
|
34
34
|
|
|
@@ -246,7 +246,7 @@ Defined in: node\_modules/.pnpm/typescript@5.8.2/node\_modules/typescript/lib/li
|
|
|
246
246
|
|
|
247
247
|
> **get** **size**(): `number`
|
|
248
248
|
|
|
249
|
-
Defined in: [src/deque.ts:172](https://github.com/isdk/util.js/blob/
|
|
249
|
+
Defined in: [src/deque.ts:172](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/deque.ts#L172)
|
|
250
250
|
|
|
251
251
|
Gets the number of elements in the deque.
|
|
252
252
|
|
|
@@ -317,7 +317,7 @@ The zero-based index of the desired code unit. A negative index will count back
|
|
|
317
317
|
|
|
318
318
|
> **clear**(): `void`
|
|
319
319
|
|
|
320
|
-
Defined in: [src/deque.ts:206](https://github.com/isdk/util.js/blob/
|
|
320
|
+
Defined in: [src/deque.ts:206](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/deque.ts#L206)
|
|
321
321
|
|
|
322
322
|
#### Returns
|
|
323
323
|
|
|
@@ -851,7 +851,7 @@ An object to which the this keyword can refer in the callbackfn function. If thi
|
|
|
851
851
|
|
|
852
852
|
> **get**(`index`): `T` \| `undefined`
|
|
853
853
|
|
|
854
|
-
Defined in: [src/deque.ts:176](https://github.com/isdk/util.js/blob/
|
|
854
|
+
Defined in: [src/deque.ts:176](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/deque.ts#L176)
|
|
855
855
|
|
|
856
856
|
#### Parameters
|
|
857
857
|
|
|
@@ -933,7 +933,7 @@ The array index at which to begin the search. If fromIndex is omitted, the searc
|
|
|
933
933
|
|
|
934
934
|
> **isEmpty**(): `boolean`
|
|
935
935
|
|
|
936
|
-
Defined in: [src/deque.ts:217](https://github.com/isdk/util.js/blob/
|
|
936
|
+
Defined in: [src/deque.ts:217](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/deque.ts#L217)
|
|
937
937
|
|
|
938
938
|
#### Returns
|
|
939
939
|
|
|
@@ -1059,7 +1059,7 @@ An object to which the this keyword can refer in the callbackfn function. If thi
|
|
|
1059
1059
|
|
|
1060
1060
|
> **peekBack**(): `T` \| `undefined`
|
|
1061
1061
|
|
|
1062
|
-
Defined in: [src/deque.ts:190](https://github.com/isdk/util.js/blob/
|
|
1062
|
+
Defined in: [src/deque.ts:190](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/deque.ts#L190)
|
|
1063
1063
|
|
|
1064
1064
|
#### Returns
|
|
1065
1065
|
|
|
@@ -1071,7 +1071,7 @@ Defined in: [src/deque.ts:190](https://github.com/isdk/util.js/blob/1244ecc63e69
|
|
|
1071
1071
|
|
|
1072
1072
|
> **peekFront**(): `T` \| `undefined`
|
|
1073
1073
|
|
|
1074
|
-
Defined in: [src/deque.ts:199](https://github.com/isdk/util.js/blob/
|
|
1074
|
+
Defined in: [src/deque.ts:199](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/deque.ts#L199)
|
|
1075
1075
|
|
|
1076
1076
|
#### Returns
|
|
1077
1077
|
|
|
@@ -1083,7 +1083,7 @@ Defined in: [src/deque.ts:199](https://github.com/isdk/util.js/blob/1244ecc63e69
|
|
|
1083
1083
|
|
|
1084
1084
|
> **pop**(`skipNull?`): `T` \| `undefined`
|
|
1085
1085
|
|
|
1086
|
-
Defined in: [src/deque.ts:102](https://github.com/isdk/util.js/blob/
|
|
1086
|
+
Defined in: [src/deque.ts:102](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/deque.ts#L102)
|
|
1087
1087
|
|
|
1088
1088
|
Removes and returns the element at the back of the deque.
|
|
1089
1089
|
|
|
@@ -1133,7 +1133,7 @@ mixedDeque.pop(false); // null (explicitly not skipping)
|
|
|
1133
1133
|
|
|
1134
1134
|
> **push**(`item`): `number`
|
|
1135
1135
|
|
|
1136
|
-
Defined in: [src/deque.ts:52](https://github.com/isdk/util.js/blob/
|
|
1136
|
+
Defined in: [src/deque.ts:52](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/deque.ts#L52)
|
|
1137
1137
|
|
|
1138
1138
|
Appends new elements to the end of an array, and returns the new length of the array.
|
|
1139
1139
|
|
|
@@ -1333,7 +1333,7 @@ If initialValue is specified, it is used as the initial value to start the accum
|
|
|
1333
1333
|
|
|
1334
1334
|
> **removeAt**(`index`): `T` \| `undefined`
|
|
1335
1335
|
|
|
1336
|
-
Defined in: [src/deque.ts:226](https://github.com/isdk/util.js/blob/
|
|
1336
|
+
Defined in: [src/deque.ts:226](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/deque.ts#L226)
|
|
1337
1337
|
|
|
1338
1338
|
Removes the element at the specified index.
|
|
1339
1339
|
|
|
@@ -1376,7 +1376,7 @@ This method mutates the array and returns a reference to the same array.
|
|
|
1376
1376
|
|
|
1377
1377
|
> **shift**(`skipNull?`): `T` \| `undefined`
|
|
1378
1378
|
|
|
1379
|
-
Defined in: [src/deque.ts:142](https://github.com/isdk/util.js/blob/
|
|
1379
|
+
Defined in: [src/deque.ts:142](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/deque.ts#L142)
|
|
1380
1380
|
|
|
1381
1381
|
Removes and returns the element at the front of the deque.
|
|
1382
1382
|
|
|
@@ -1665,7 +1665,7 @@ Returns a string representation of an array.
|
|
|
1665
1665
|
|
|
1666
1666
|
> **unshift**(`item`): `number`
|
|
1667
1667
|
|
|
1668
|
-
Defined in: [src/deque.ts:65](https://github.com/isdk/util.js/blob/
|
|
1668
|
+
Defined in: [src/deque.ts:65](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/deque.ts#L65)
|
|
1669
1669
|
|
|
1670
1670
|
Inserts new elements at the start of an array, and returns the new length of the array.
|
|
1671
1671
|
|
package/docs/classes/IntSet.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: IntSet
|
|
8
8
|
|
|
9
|
-
Defined in: [src/intset.ts:6](https://github.com/isdk/util.js/blob/
|
|
9
|
+
Defined in: [src/intset.ts:6](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/intset.ts#L6)
|
|
10
10
|
|
|
11
11
|
Represents a set of integers using a bit field.
|
|
12
12
|
Each bit in the bit field represents an integer starting from 0,
|
|
@@ -16,13 +16,13 @@ where the flag value 0 represents the 0th bit, 1 represents the 1st bit, and so
|
|
|
16
16
|
|
|
17
17
|
### Constructor
|
|
18
18
|
|
|
19
|
-
> **new IntSet**(`bitField
|
|
19
|
+
> **new IntSet**(`bitField?`): `IntSet`
|
|
20
20
|
|
|
21
|
-
Defined in: [src/intset.ts:21](https://github.com/isdk/util.js/blob/
|
|
21
|
+
Defined in: [src/intset.ts:21](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/intset.ts#L21)
|
|
22
22
|
|
|
23
23
|
#### Parameters
|
|
24
24
|
|
|
25
|
-
##### bitField
|
|
25
|
+
##### bitField?
|
|
26
26
|
|
|
27
27
|
`number` = `0`
|
|
28
28
|
|
|
@@ -36,7 +36,7 @@ Defined in: [src/intset.ts:21](https://github.com/isdk/util.js/blob/1244ecc63e69
|
|
|
36
36
|
|
|
37
37
|
> **add**(`flag`): `IntSet`
|
|
38
38
|
|
|
39
|
-
Defined in: [src/intset.ts:29](https://github.com/isdk/util.js/blob/
|
|
39
|
+
Defined in: [src/intset.ts:29](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/intset.ts#L29)
|
|
40
40
|
|
|
41
41
|
Adds an element to the set.
|
|
42
42
|
|
|
@@ -59,7 +59,7 @@ The flag value representing the bit position to set.
|
|
|
59
59
|
|
|
60
60
|
> **clear**(): `IntSet`
|
|
61
61
|
|
|
62
|
-
Defined in: [src/intset.ts:57](https://github.com/isdk/util.js/blob/
|
|
62
|
+
Defined in: [src/intset.ts:57](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/intset.ts#L57)
|
|
63
63
|
|
|
64
64
|
Clears all elements from the set.
|
|
65
65
|
|
|
@@ -73,7 +73,7 @@ Clears all elements from the set.
|
|
|
73
73
|
|
|
74
74
|
> **delete**(`flag`): `IntSet`
|
|
75
75
|
|
|
76
|
-
Defined in: [src/intset.ts:39](https://github.com/isdk/util.js/blob/
|
|
76
|
+
Defined in: [src/intset.ts:39](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/intset.ts#L39)
|
|
77
77
|
|
|
78
78
|
Removes an element from the set.
|
|
79
79
|
|
|
@@ -95,7 +95,7 @@ The flag value representing the bit position to set. 0 represents the 0th bit
|
|
|
95
95
|
|
|
96
96
|
> **has**(`flag`): `boolean`
|
|
97
97
|
|
|
98
|
-
Defined in: [src/intset.ts:50](https://github.com/isdk/util.js/blob/
|
|
98
|
+
Defined in: [src/intset.ts:50](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/intset.ts#L50)
|
|
99
99
|
|
|
100
100
|
Determines whether an element is in the set.
|
|
101
101
|
|
|
@@ -119,7 +119,7 @@ true if the element is in the set; otherwise, false.
|
|
|
119
119
|
|
|
120
120
|
> **toJSON**(): `number`
|
|
121
121
|
|
|
122
|
-
Defined in: [src/intset.ts:70](https://github.com/isdk/util.js/blob/
|
|
122
|
+
Defined in: [src/intset.ts:70](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/intset.ts#L70)
|
|
123
123
|
|
|
124
124
|
#### Returns
|
|
125
125
|
|
|
@@ -131,7 +131,7 @@ Defined in: [src/intset.ts:70](https://github.com/isdk/util.js/blob/1244ecc63e69
|
|
|
131
131
|
|
|
132
132
|
> **toString**(): `string`
|
|
133
133
|
|
|
134
|
-
Defined in: [src/intset.ts:66](https://github.com/isdk/util.js/blob/
|
|
134
|
+
Defined in: [src/intset.ts:66](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/intset.ts#L66)
|
|
135
135
|
|
|
136
136
|
#### Returns
|
|
137
137
|
|
|
@@ -143,7 +143,7 @@ Defined in: [src/intset.ts:66](https://github.com/isdk/util.js/blob/1244ecc63e69
|
|
|
143
143
|
|
|
144
144
|
> **valueOf**(): `number`
|
|
145
145
|
|
|
146
|
-
Defined in: [src/intset.ts:62](https://github.com/isdk/util.js/blob/
|
|
146
|
+
Defined in: [src/intset.ts:62](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/intset.ts#L62)
|
|
147
147
|
|
|
148
148
|
#### Returns
|
|
149
149
|
|
|
@@ -155,7 +155,7 @@ Defined in: [src/intset.ts:62](https://github.com/isdk/util.js/blob/1244ecc63e69
|
|
|
155
155
|
|
|
156
156
|
> `static` **add**(`bitField`, `flag`): `number`
|
|
157
157
|
|
|
158
|
-
Defined in: [src/intset.ts:12](https://github.com/isdk/util.js/blob/
|
|
158
|
+
Defined in: [src/intset.ts:12](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/intset.ts#L12)
|
|
159
159
|
|
|
160
160
|
#### Parameters
|
|
161
161
|
|
|
@@ -177,7 +177,7 @@ Defined in: [src/intset.ts:12](https://github.com/isdk/util.js/blob/1244ecc63e69
|
|
|
177
177
|
|
|
178
178
|
> `static` **delete**(`bitField`, `flag`): `number`
|
|
179
179
|
|
|
180
|
-
Defined in: [src/intset.ts:16](https://github.com/isdk/util.js/blob/
|
|
180
|
+
Defined in: [src/intset.ts:16](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/intset.ts#L16)
|
|
181
181
|
|
|
182
182
|
#### Parameters
|
|
183
183
|
|
|
@@ -199,7 +199,7 @@ Defined in: [src/intset.ts:16](https://github.com/isdk/util.js/blob/1244ecc63e69
|
|
|
199
199
|
|
|
200
200
|
> `static` **has**(`bitField`, `flag`): `boolean`
|
|
201
201
|
|
|
202
|
-
Defined in: [src/intset.ts:8](https://github.com/isdk/util.js/blob/
|
|
202
|
+
Defined in: [src/intset.ts:8](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/intset.ts#L8)
|
|
203
203
|
|
|
204
204
|
#### Parameters
|
|
205
205
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: Semaphore
|
|
8
8
|
|
|
9
|
-
Defined in: [src/async-semaphore.ts:372](https://github.com/isdk/util.js/blob/
|
|
9
|
+
Defined in: [src/async-semaphore.ts:372](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L372)
|
|
10
10
|
|
|
11
11
|
A Semaphore implementation for managing concurrency in asynchronous operations.
|
|
12
12
|
Semaphores allow a fixed number of resources to be accessed concurrently.
|
|
@@ -57,7 +57,7 @@ const data = await Promise.all(array.map(fetchData));
|
|
|
57
57
|
|
|
58
58
|
> **new Semaphore**(`maxConcurrency`, `options?`): `Semaphore`
|
|
59
59
|
|
|
60
|
-
Defined in: [src/async-semaphore.ts:390](https://github.com/isdk/util.js/blob/
|
|
60
|
+
Defined in: [src/async-semaphore.ts:390](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L390)
|
|
61
61
|
|
|
62
62
|
Creates a semaphore object. The first argument is the maximum concurrently number and the second argument is optional.
|
|
63
63
|
|
|
@@ -87,7 +87,7 @@ The maximum number of callers allowed to acquire the semaphore concurrently.
|
|
|
87
87
|
|
|
88
88
|
> `protected` **\_activeCount**: `number`
|
|
89
89
|
|
|
90
|
-
Defined in: [src/async-semaphore.ts:97](https://github.com/isdk/util.js/blob/
|
|
90
|
+
Defined in: [src/async-semaphore.ts:97](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L97)
|
|
91
91
|
|
|
92
92
|
#### Inherited from
|
|
93
93
|
|
|
@@ -99,7 +99,7 @@ Defined in: [src/async-semaphore.ts:97](https://github.com/isdk/util.js/blob/124
|
|
|
99
99
|
|
|
100
100
|
> `protected` **emitter**: `EventEmitter`
|
|
101
101
|
|
|
102
|
-
Defined in: [src/async-semaphore.ts:91](https://github.com/isdk/util.js/blob/
|
|
102
|
+
Defined in: [src/async-semaphore.ts:91](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L91)
|
|
103
103
|
|
|
104
104
|
#### Inherited from
|
|
105
105
|
|
|
@@ -111,7 +111,7 @@ Defined in: [src/async-semaphore.ts:91](https://github.com/isdk/util.js/blob/124
|
|
|
111
111
|
|
|
112
112
|
> `protected` **free**: [`Deque`](Deque.md)\<`any`\>
|
|
113
113
|
|
|
114
|
-
Defined in: [src/async-semaphore.ts:374](https://github.com/isdk/util.js/blob/
|
|
114
|
+
Defined in: [src/async-semaphore.ts:374](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L374)
|
|
115
115
|
|
|
116
116
|
#### Overrides
|
|
117
117
|
|
|
@@ -123,7 +123,7 @@ Defined in: [src/async-semaphore.ts:374](https://github.com/isdk/util.js/blob/12
|
|
|
123
123
|
|
|
124
124
|
> `protected` **initTokenFn**: (`token?`) => `void`
|
|
125
125
|
|
|
126
|
-
Defined in: [src/async-semaphore.ts:95](https://github.com/isdk/util.js/blob/
|
|
126
|
+
Defined in: [src/async-semaphore.ts:95](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L95)
|
|
127
127
|
|
|
128
128
|
#### Parameters
|
|
129
129
|
|
|
@@ -145,7 +145,7 @@ Defined in: [src/async-semaphore.ts:95](https://github.com/isdk/util.js/blob/124
|
|
|
145
145
|
|
|
146
146
|
> `readonly` **maxConcurrency**: `number`
|
|
147
147
|
|
|
148
|
-
Defined in: [src/async-semaphore.ts:373](https://github.com/isdk/util.js/blob/
|
|
148
|
+
Defined in: [src/async-semaphore.ts:373](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L373)
|
|
149
149
|
|
|
150
150
|
***
|
|
151
151
|
|
|
@@ -153,7 +153,7 @@ Defined in: [src/async-semaphore.ts:373](https://github.com/isdk/util.js/blob/12
|
|
|
153
153
|
|
|
154
154
|
> `protected` **paused**: `boolean`
|
|
155
155
|
|
|
156
|
-
Defined in: [src/async-semaphore.ts:96](https://github.com/isdk/util.js/blob/
|
|
156
|
+
Defined in: [src/async-semaphore.ts:96](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L96)
|
|
157
157
|
|
|
158
158
|
#### Inherited from
|
|
159
159
|
|
|
@@ -165,7 +165,7 @@ Defined in: [src/async-semaphore.ts:96](https://github.com/isdk/util.js/blob/124
|
|
|
165
165
|
|
|
166
166
|
> `protected` `optional` **pauseFn**: () => `void`
|
|
167
167
|
|
|
168
|
-
Defined in: [src/async-semaphore.ts:93](https://github.com/isdk/util.js/blob/
|
|
168
|
+
Defined in: [src/async-semaphore.ts:93](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L93)
|
|
169
169
|
|
|
170
170
|
#### Returns
|
|
171
171
|
|
|
@@ -181,7 +181,7 @@ Defined in: [src/async-semaphore.ts:93](https://github.com/isdk/util.js/blob/124
|
|
|
181
181
|
|
|
182
182
|
> `protected` `optional` **resumeFn**: () => `void`
|
|
183
183
|
|
|
184
|
-
Defined in: [src/async-semaphore.ts:94](https://github.com/isdk/util.js/blob/
|
|
184
|
+
Defined in: [src/async-semaphore.ts:94](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L94)
|
|
185
185
|
|
|
186
186
|
#### Returns
|
|
187
187
|
|
|
@@ -197,7 +197,7 @@ Defined in: [src/async-semaphore.ts:94](https://github.com/isdk/util.js/blob/124
|
|
|
197
197
|
|
|
198
198
|
> `protected` **useDefaultTokens**: `boolean`
|
|
199
199
|
|
|
200
|
-
Defined in: [src/async-semaphore.ts:92](https://github.com/isdk/util.js/blob/
|
|
200
|
+
Defined in: [src/async-semaphore.ts:92](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L92)
|
|
201
201
|
|
|
202
202
|
#### Inherited from
|
|
203
203
|
|
|
@@ -209,7 +209,7 @@ Defined in: [src/async-semaphore.ts:92](https://github.com/isdk/util.js/blob/124
|
|
|
209
209
|
|
|
210
210
|
> `readonly` **waiting**: [`Deque`](Deque.md)\<[`SemaphoreTaskItem`](../interfaces/SemaphoreTaskItem.md) \| `undefined`\>
|
|
211
211
|
|
|
212
|
-
Defined in: [src/async-semaphore.ts:89](https://github.com/isdk/util.js/blob/
|
|
212
|
+
Defined in: [src/async-semaphore.ts:89](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L89)
|
|
213
213
|
|
|
214
214
|
#### Inherited from
|
|
215
215
|
|
|
@@ -223,7 +223,7 @@ Defined in: [src/async-semaphore.ts:89](https://github.com/isdk/util.js/blob/124
|
|
|
223
223
|
|
|
224
224
|
> **get** **activeCount**(): `number`
|
|
225
225
|
|
|
226
|
-
Defined in: [src/async-semaphore.ts:318](https://github.com/isdk/util.js/blob/
|
|
226
|
+
Defined in: [src/async-semaphore.ts:318](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L318)
|
|
227
227
|
|
|
228
228
|
Get the total count of all active operations.
|
|
229
229
|
|
|
@@ -249,7 +249,7 @@ The total count of active operations, including both waiting and ongoing tasks.
|
|
|
249
249
|
|
|
250
250
|
> **get** **pendingCount**(): `number`
|
|
251
251
|
|
|
252
|
-
Defined in: [src/async-semaphore.ts:327](https://github.com/isdk/util.js/blob/
|
|
252
|
+
Defined in: [src/async-semaphore.ts:327](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L327)
|
|
253
253
|
|
|
254
254
|
Get the number of callers waiting on the semaphore, i.e. the number of pending promises.
|
|
255
255
|
|
|
@@ -269,7 +269,7 @@ The number of waiters in the waiting list.
|
|
|
269
269
|
|
|
270
270
|
> **\_dispatchTask**(`task`, `options?`): `void`
|
|
271
271
|
|
|
272
|
-
Defined in: [src/async-semaphore.ts:212](https://github.com/isdk/util.js/blob/
|
|
272
|
+
Defined in: [src/async-semaphore.ts:212](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L212)
|
|
273
273
|
|
|
274
274
|
#### Parameters
|
|
275
275
|
|
|
@@ -295,7 +295,7 @@ Defined in: [src/async-semaphore.ts:212](https://github.com/isdk/util.js/blob/12
|
|
|
295
295
|
|
|
296
296
|
> **\_newReleaser**(`options?`): [`BinarySemaphoreReleaserFunc`](../interfaces/BinarySemaphoreReleaserFunc.md)
|
|
297
297
|
|
|
298
|
-
Defined in: [src/async-semaphore.ts:199](https://github.com/isdk/util.js/blob/
|
|
298
|
+
Defined in: [src/async-semaphore.ts:199](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L199)
|
|
299
299
|
|
|
300
300
|
#### Parameters
|
|
301
301
|
|
|
@@ -317,7 +317,7 @@ Defined in: [src/async-semaphore.ts:199](https://github.com/isdk/util.js/blob/12
|
|
|
317
317
|
|
|
318
318
|
> **abort**(`reason?`): `void`
|
|
319
319
|
|
|
320
|
-
Defined in: [src/async-semaphore.ts:301](https://github.com/isdk/util.js/blob/
|
|
320
|
+
Defined in: [src/async-semaphore.ts:301](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L301)
|
|
321
321
|
|
|
322
322
|
#### Parameters
|
|
323
323
|
|
|
@@ -339,7 +339,7 @@ Defined in: [src/async-semaphore.ts:301](https://github.com/isdk/util.js/blob/12
|
|
|
339
339
|
|
|
340
340
|
> **acquire**(`options?`): `Promise`\<[`BinarySemaphoreReleaserFunc`](../interfaces/BinarySemaphoreReleaserFunc.md)\>
|
|
341
341
|
|
|
342
|
-
Defined in: [src/async-semaphore.ts:243](https://github.com/isdk/util.js/blob/
|
|
342
|
+
Defined in: [src/async-semaphore.ts:243](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L243)
|
|
343
343
|
|
|
344
344
|
Acquire a token from the semaphore, thus decrement the number of available execution slots. If initFn is not used then the return value of the function can be discarded.
|
|
345
345
|
|
|
@@ -365,7 +365,7 @@ A promise that resolves to a release function when a token is acquired. If the s
|
|
|
365
365
|
|
|
366
366
|
> **drain**(): `Promise`\<`any`[]\>
|
|
367
367
|
|
|
368
|
-
Defined in: [src/async-semaphore.ts:439](https://github.com/isdk/util.js/blob/
|
|
368
|
+
Defined in: [src/async-semaphore.ts:439](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L439)
|
|
369
369
|
|
|
370
370
|
Drains the semaphore and returns all the initialized tokens in an array. Draining is an ideal way to ensure there are no pending async tasks, for example before a process will terminate.
|
|
371
371
|
|
|
@@ -383,7 +383,7 @@ Drains the semaphore and returns all the initialized tokens in an array. Drainin
|
|
|
383
383
|
|
|
384
384
|
> **init**(`options`): `void`
|
|
385
385
|
|
|
386
|
-
Defined in: [src/async-semaphore.ts:193](https://github.com/isdk/util.js/blob/
|
|
386
|
+
Defined in: [src/async-semaphore.ts:193](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L193)
|
|
387
387
|
|
|
388
388
|
#### Parameters
|
|
389
389
|
|
|
@@ -405,7 +405,7 @@ Defined in: [src/async-semaphore.ts:193](https://github.com/isdk/util.js/blob/12
|
|
|
405
405
|
|
|
406
406
|
> **initFree**(`options`): `void`
|
|
407
407
|
|
|
408
|
-
Defined in: [src/async-semaphore.ts:408](https://github.com/isdk/util.js/blob/
|
|
408
|
+
Defined in: [src/async-semaphore.ts:408](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L408)
|
|
409
409
|
|
|
410
410
|
#### Parameters
|
|
411
411
|
|
|
@@ -427,7 +427,7 @@ Defined in: [src/async-semaphore.ts:408](https://github.com/isdk/util.js/blob/12
|
|
|
427
427
|
|
|
428
428
|
> **lock**(`options?`): `any`
|
|
429
429
|
|
|
430
|
-
Defined in: [src/async-semaphore.ts:435](https://github.com/isdk/util.js/blob/
|
|
430
|
+
Defined in: [src/async-semaphore.ts:435](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L435)
|
|
431
431
|
|
|
432
432
|
#### Parameters
|
|
433
433
|
|
|
@@ -449,7 +449,7 @@ Defined in: [src/async-semaphore.ts:435](https://github.com/isdk/util.js/blob/12
|
|
|
449
449
|
|
|
450
450
|
> **onReleased**(`options?`): `void`
|
|
451
451
|
|
|
452
|
-
Defined in: [src/async-semaphore.ts:177](https://github.com/isdk/util.js/blob/
|
|
452
|
+
Defined in: [src/async-semaphore.ts:177](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L177)
|
|
453
453
|
|
|
454
454
|
#### Parameters
|
|
455
455
|
|
|
@@ -471,7 +471,7 @@ Defined in: [src/async-semaphore.ts:177](https://github.com/isdk/util.js/blob/12
|
|
|
471
471
|
|
|
472
472
|
> **release**(`options?`): `void`
|
|
473
473
|
|
|
474
|
-
Defined in: [src/async-semaphore.ts:288](https://github.com/isdk/util.js/blob/
|
|
474
|
+
Defined in: [src/async-semaphore.ts:288](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L288)
|
|
475
475
|
|
|
476
476
|
Releases the semaphore, incrementing the number of free execution slots. If there are tasks in the waiting queue, the next task will be dispatched.
|
|
477
477
|
|
|
@@ -495,7 +495,7 @@ Releases the semaphore, incrementing the number of free execution slots. If ther
|
|
|
495
495
|
|
|
496
496
|
> **tryAcquire**(`options?`): `any`
|
|
497
497
|
|
|
498
|
-
Defined in: [src/async-semaphore.ts:416](https://github.com/isdk/util.js/blob/
|
|
498
|
+
Defined in: [src/async-semaphore.ts:416](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L416)
|
|
499
499
|
|
|
500
500
|
Attempt to acquire a token from the semaphore, if one is available immediately. Otherwise, return undefined.
|
|
501
501
|
|
|
@@ -521,7 +521,7 @@ Returns a token if the semaphore is not full; otherwise, returns `undefined`.
|
|
|
521
521
|
|
|
522
522
|
> **unlock**(`token?`): `void`
|
|
523
523
|
|
|
524
|
-
Defined in: [src/async-semaphore.ts:431](https://github.com/isdk/util.js/blob/
|
|
524
|
+
Defined in: [src/async-semaphore.ts:431](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L431)
|
|
525
525
|
|
|
526
526
|
#### Parameters
|
|
527
527
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: SignalGate\<T\>
|
|
8
8
|
|
|
9
|
-
Defined in: [src/async-signal-gate.ts:20](https://github.com/isdk/util.js/blob/
|
|
9
|
+
Defined in: [src/async-signal-gate.ts:20](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-signal-gate.ts#L20)
|
|
10
10
|
|
|
11
11
|
An asynchronous signal gate that blocks operations until a signal is emitted.
|
|
12
12
|
This class allows multiple awaiters to wait for a signal and resolves all pending promises with the emitted value.
|
|
@@ -46,7 +46,7 @@ valueGate.signal(42); // Must provide a number value
|
|
|
46
46
|
|
|
47
47
|
> `protected` **\_isSignaled**: `boolean` = `false`
|
|
48
48
|
|
|
49
|
-
Defined in: [src/async-signal-gate.ts:21](https://github.com/isdk/util.js/blob/
|
|
49
|
+
Defined in: [src/async-signal-gate.ts:21](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-signal-gate.ts#L21)
|
|
50
50
|
|
|
51
51
|
***
|
|
52
52
|
|
|
@@ -54,7 +54,7 @@ Defined in: [src/async-signal-gate.ts:21](https://github.com/isdk/util.js/blob/1
|
|
|
54
54
|
|
|
55
55
|
> `protected` **\_signalValue**: `T` \| `undefined`
|
|
56
56
|
|
|
57
|
-
Defined in: [src/async-signal-gate.ts:22](https://github.com/isdk/util.js/blob/
|
|
57
|
+
Defined in: [src/async-signal-gate.ts:22](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-signal-gate.ts#L22)
|
|
58
58
|
|
|
59
59
|
***
|
|
60
60
|
|
|
@@ -62,7 +62,7 @@ Defined in: [src/async-signal-gate.ts:22](https://github.com/isdk/util.js/blob/1
|
|
|
62
62
|
|
|
63
63
|
> `protected` **waitQueue**: `object`[] = `[]`
|
|
64
64
|
|
|
65
|
-
Defined in: [src/async-signal-gate.ts:23](https://github.com/isdk/util.js/blob/
|
|
65
|
+
Defined in: [src/async-signal-gate.ts:23](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-signal-gate.ts#L23)
|
|
66
66
|
|
|
67
67
|
#### reject()
|
|
68
68
|
|
|
@@ -100,7 +100,7 @@ Defined in: [src/async-signal-gate.ts:23](https://github.com/isdk/util.js/blob/1
|
|
|
100
100
|
|
|
101
101
|
> **get** **signaled**(): `boolean`
|
|
102
102
|
|
|
103
|
-
Defined in: [src/async-signal-gate.ts:28](https://github.com/isdk/util.js/blob/
|
|
103
|
+
Defined in: [src/async-signal-gate.ts:28](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-signal-gate.ts#L28)
|
|
104
104
|
|
|
105
105
|
##### Returns
|
|
106
106
|
|
|
@@ -112,7 +112,7 @@ Defined in: [src/async-signal-gate.ts:28](https://github.com/isdk/util.js/blob/1
|
|
|
112
112
|
|
|
113
113
|
> **abort**(`reason?`): `void`
|
|
114
114
|
|
|
115
|
-
Defined in: [src/async-signal-gate.ts:65](https://github.com/isdk/util.js/blob/
|
|
115
|
+
Defined in: [src/async-signal-gate.ts:65](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-signal-gate.ts#L65)
|
|
116
116
|
|
|
117
117
|
Aborts all pending waits, rejecting their promises with an error.
|
|
118
118
|
This does **not** reset the signal state (the gate remains signaled or unsignaled).
|
|
@@ -135,7 +135,7 @@ The reason for aborting the waits.
|
|
|
135
135
|
|
|
136
136
|
> **reset**(): `void`
|
|
137
137
|
|
|
138
|
-
Defined in: [src/async-signal-gate.ts:53](https://github.com/isdk/util.js/blob/
|
|
138
|
+
Defined in: [src/async-signal-gate.ts:53](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-signal-gate.ts#L53)
|
|
139
139
|
|
|
140
140
|
Resets the gate to its initial state, allowing a new signal to be emitted.
|
|
141
141
|
|
|
@@ -149,7 +149,7 @@ Resets the gate to its initial state, allowing a new signal to be emitted.
|
|
|
149
149
|
|
|
150
150
|
> **signal**(`value?`): `void`
|
|
151
151
|
|
|
152
|
-
Defined in: [src/async-signal-gate.ts:38](https://github.com/isdk/util.js/blob/
|
|
152
|
+
Defined in: [src/async-signal-gate.ts:38](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-signal-gate.ts#L38)
|
|
153
153
|
|
|
154
154
|
Emits the signal with an optional value, resolving all pending [wait](#wait) promises.
|
|
155
155
|
Subsequent calls have no effect until [reset](#reset) is called.
|
|
@@ -172,7 +172,7 @@ The value to emit with the signal (only required if T is not void).
|
|
|
172
172
|
|
|
173
173
|
> **wait**(): `Promise`\<`T`\>
|
|
174
174
|
|
|
175
|
-
Defined in: [src/async-signal-gate.ts:83](https://github.com/isdk/util.js/blob/
|
|
175
|
+
Defined in: [src/async-signal-gate.ts:83](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-signal-gate.ts#L83)
|
|
176
176
|
|
|
177
177
|
Returns a promise that resolves with the emitted signal value.
|
|
178
178
|
If called after the signal has been emitted, resolves immediately with the stored value.
|
|
@@ -6,9 +6,9 @@
|
|
|
6
6
|
|
|
7
7
|
# Function: RateLimit()
|
|
8
8
|
|
|
9
|
-
> **RateLimit**(`rps`, `__namedParameters
|
|
9
|
+
> **RateLimit**(`rps`, `__namedParameters?`): () => `Promise`\<`void`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [src/async-semaphore.ts:476](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/async-semaphore.ts:476](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/async-semaphore.ts#L476)
|
|
12
12
|
|
|
13
13
|
Creates a rate limiter function that blocks with a promise whenever the rate limit is hit and resolves the promise once the call rate is within the limit set by rps. The second argument is optional.
|
|
14
14
|
|
|
@@ -18,7 +18,7 @@ Creates a rate limiter function that blocks with a promise whenever the rate lim
|
|
|
18
18
|
|
|
19
19
|
`number`
|
|
20
20
|
|
|
21
|
-
### \_\_namedParameters
|
|
21
|
+
### \_\_namedParameters?
|
|
22
22
|
|
|
23
23
|
#### timeUnit?
|
|
24
24
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **arrayHasAll**\<`T`\>(`array`, `elements`): `boolean`
|
|
10
10
|
|
|
11
|
-
Defined in: [src/array-has-all.ts:15](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/array-has-all.ts:15](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/array-has-all.ts#L15)
|
|
12
12
|
|
|
13
13
|
Checks whether the provided array contains all of the specified elements.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **extNameLevel**(`extName`): `number`
|
|
10
10
|
|
|
11
|
-
Defined in: [src/filename.ts:189](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/filename.ts:189](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/filename.ts#L189)
|
|
12
12
|
|
|
13
13
|
Calculates the level of an extension name.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **filenameReservedRegex**(): `RegExp`
|
|
10
10
|
|
|
11
|
-
Defined in: [src/filename.ts:42](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/filename.ts:42](https://github.com/isdk/util.js/blob/61856e5b1bbb9d976eeb1fdfe1a4d88a26997dec/src/filename.ts#L42)
|
|
12
12
|
|
|
13
13
|
Returns a new regular expression instance for reserved filename characters with the 'g' flag.
|
|
14
14
|
use this to reset the with global option
|