@isdk/util 0.3.6 → 0.3.7
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 +104 -23
- package/dist/index.d.ts +104 -23
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/classes/BinarySemaphore.md +25 -25
- package/docs/classes/ConfigFile.md +6 -6
- package/docs/classes/Deque.md +13 -13
- package/docs/classes/IntSet.md +12 -12
- package/docs/classes/Semaphore.md +26 -26
- package/docs/classes/SignalGate.md +9 -9
- package/docs/functions/RateLimit.md +1 -1
- package/docs/functions/arrayHasAll.md +1 -1
- package/docs/functions/extNameLevel.md +1 -1
- package/docs/functions/extractCodeBlock.md +91 -0
- package/docs/functions/filenameReservedRegex.md +1 -1
- package/docs/functions/findPort.md +1 -1
- package/docs/functions/getMultiLevelExtname.md +1 -1
- 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 +1 -1
- package/docs/functions/omitEmptyDeep.md +1 -1
- package/docs/functions/parseFrontMatter.md +1 -1
- 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 +1 -1
- package/docs/functions/sanitizeFilepath.md +1 -1
- 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 +3 -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/CodeString.md +1712 -0
- package/docs/interfaces/ExtractCodeBlockOptions.md +43 -0
- 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 +2 -1
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Class: BinarySemaphore
|
|
8
8
|
|
|
9
|
-
Defined in: [src/async-semaphore.ts:88](https://github.com/isdk/util.js/blob/
|
|
9
|
+
Defined in: [src/async-semaphore.ts:88](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L88)
|
|
10
10
|
|
|
11
11
|
A binary semaphore implementation for managing concurrency in asynchronous operations.
|
|
12
12
|
Unlike a general semaphore, a binary semaphore allows only one caller to acquire the semaphore at a time.
|
|
@@ -47,7 +47,7 @@ const data = await Promise.all(array.map(fetchData));
|
|
|
47
47
|
|
|
48
48
|
> **new BinarySemaphore**(`options?`): `BinarySemaphore`
|
|
49
49
|
|
|
50
|
-
Defined in: [src/async-semaphore.ts:145](https://github.com/isdk/util.js/blob/
|
|
50
|
+
Defined in: [src/async-semaphore.ts:145](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L145)
|
|
51
51
|
|
|
52
52
|
Creates a binary semaphore object for managing concurrency in asynchronous operations.
|
|
53
53
|
|
|
@@ -67,7 +67,7 @@ Creates a binary semaphore object for managing concurrency in asynchronous opera
|
|
|
67
67
|
|
|
68
68
|
> `protected` **\_activeCount**: `number`
|
|
69
69
|
|
|
70
|
-
Defined in: [src/async-semaphore.ts:97](https://github.com/isdk/util.js/blob/
|
|
70
|
+
Defined in: [src/async-semaphore.ts:97](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L97)
|
|
71
71
|
|
|
72
72
|
***
|
|
73
73
|
|
|
@@ -75,7 +75,7 @@ Defined in: [src/async-semaphore.ts:97](https://github.com/isdk/util.js/blob/618
|
|
|
75
75
|
|
|
76
76
|
> `protected` **emitter**: `EventEmitter`
|
|
77
77
|
|
|
78
|
-
Defined in: [src/async-semaphore.ts:91](https://github.com/isdk/util.js/blob/
|
|
78
|
+
Defined in: [src/async-semaphore.ts:91](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L91)
|
|
79
79
|
|
|
80
80
|
***
|
|
81
81
|
|
|
@@ -83,7 +83,7 @@ Defined in: [src/async-semaphore.ts:91](https://github.com/isdk/util.js/blob/618
|
|
|
83
83
|
|
|
84
84
|
> `protected` **free**: `any`
|
|
85
85
|
|
|
86
|
-
Defined in: [src/async-semaphore.ts:90](https://github.com/isdk/util.js/blob/
|
|
86
|
+
Defined in: [src/async-semaphore.ts:90](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L90)
|
|
87
87
|
|
|
88
88
|
***
|
|
89
89
|
|
|
@@ -91,7 +91,7 @@ Defined in: [src/async-semaphore.ts:90](https://github.com/isdk/util.js/blob/618
|
|
|
91
91
|
|
|
92
92
|
> `protected` **initTokenFn**: (`token?`) => `void`
|
|
93
93
|
|
|
94
|
-
Defined in: [src/async-semaphore.ts:95](https://github.com/isdk/util.js/blob/
|
|
94
|
+
Defined in: [src/async-semaphore.ts:95](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L95)
|
|
95
95
|
|
|
96
96
|
#### Parameters
|
|
97
97
|
|
|
@@ -109,7 +109,7 @@ Defined in: [src/async-semaphore.ts:95](https://github.com/isdk/util.js/blob/618
|
|
|
109
109
|
|
|
110
110
|
> `protected` **paused**: `boolean`
|
|
111
111
|
|
|
112
|
-
Defined in: [src/async-semaphore.ts:96](https://github.com/isdk/util.js/blob/
|
|
112
|
+
Defined in: [src/async-semaphore.ts:96](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L96)
|
|
113
113
|
|
|
114
114
|
***
|
|
115
115
|
|
|
@@ -117,7 +117,7 @@ Defined in: [src/async-semaphore.ts:96](https://github.com/isdk/util.js/blob/618
|
|
|
117
117
|
|
|
118
118
|
> `protected` `optional` **pauseFn**: () => `void`
|
|
119
119
|
|
|
120
|
-
Defined in: [src/async-semaphore.ts:93](https://github.com/isdk/util.js/blob/
|
|
120
|
+
Defined in: [src/async-semaphore.ts:93](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L93)
|
|
121
121
|
|
|
122
122
|
#### Returns
|
|
123
123
|
|
|
@@ -129,7 +129,7 @@ Defined in: [src/async-semaphore.ts:93](https://github.com/isdk/util.js/blob/618
|
|
|
129
129
|
|
|
130
130
|
> `protected` `optional` **resumeFn**: () => `void`
|
|
131
131
|
|
|
132
|
-
Defined in: [src/async-semaphore.ts:94](https://github.com/isdk/util.js/blob/
|
|
132
|
+
Defined in: [src/async-semaphore.ts:94](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L94)
|
|
133
133
|
|
|
134
134
|
#### Returns
|
|
135
135
|
|
|
@@ -141,7 +141,7 @@ Defined in: [src/async-semaphore.ts:94](https://github.com/isdk/util.js/blob/618
|
|
|
141
141
|
|
|
142
142
|
> `protected` **useDefaultTokens**: `boolean`
|
|
143
143
|
|
|
144
|
-
Defined in: [src/async-semaphore.ts:92](https://github.com/isdk/util.js/blob/
|
|
144
|
+
Defined in: [src/async-semaphore.ts:92](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L92)
|
|
145
145
|
|
|
146
146
|
***
|
|
147
147
|
|
|
@@ -149,7 +149,7 @@ Defined in: [src/async-semaphore.ts:92](https://github.com/isdk/util.js/blob/618
|
|
|
149
149
|
|
|
150
150
|
> `readonly` **waiting**: [`Deque`](Deque.md)\<[`SemaphoreTaskItem`](../interfaces/SemaphoreTaskItem.md) \| `undefined`\>
|
|
151
151
|
|
|
152
|
-
Defined in: [src/async-semaphore.ts:89](https://github.com/isdk/util.js/blob/
|
|
152
|
+
Defined in: [src/async-semaphore.ts:89](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L89)
|
|
153
153
|
|
|
154
154
|
## Accessors
|
|
155
155
|
|
|
@@ -159,7 +159,7 @@ Defined in: [src/async-semaphore.ts:89](https://github.com/isdk/util.js/blob/618
|
|
|
159
159
|
|
|
160
160
|
> **get** **activeCount**(): `number`
|
|
161
161
|
|
|
162
|
-
Defined in: [src/async-semaphore.ts:
|
|
162
|
+
Defined in: [src/async-semaphore.ts:323](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L323)
|
|
163
163
|
|
|
164
164
|
Get the total count of all active operations.
|
|
165
165
|
|
|
@@ -181,7 +181,7 @@ The total count of active operations, including both waiting and ongoing tasks.
|
|
|
181
181
|
|
|
182
182
|
> **get** **pendingCount**(): `number`
|
|
183
183
|
|
|
184
|
-
Defined in: [src/async-semaphore.ts:
|
|
184
|
+
Defined in: [src/async-semaphore.ts:332](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L332)
|
|
185
185
|
|
|
186
186
|
Get the number of callers waiting on the semaphore, i.e. the number of pending promises.
|
|
187
187
|
|
|
@@ -197,7 +197,7 @@ The number of waiters in the waiting list.
|
|
|
197
197
|
|
|
198
198
|
> **\_dispatchTask**(`task`, `options?`): `void`
|
|
199
199
|
|
|
200
|
-
Defined in: [src/async-semaphore.ts:
|
|
200
|
+
Defined in: [src/async-semaphore.ts:210](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L210)
|
|
201
201
|
|
|
202
202
|
#### Parameters
|
|
203
203
|
|
|
@@ -219,7 +219,7 @@ Defined in: [src/async-semaphore.ts:212](https://github.com/isdk/util.js/blob/61
|
|
|
219
219
|
|
|
220
220
|
> **\_newReleaser**(`options?`): [`BinarySemaphoreReleaserFunc`](../interfaces/BinarySemaphoreReleaserFunc.md)
|
|
221
221
|
|
|
222
|
-
Defined in: [src/async-semaphore.ts:
|
|
222
|
+
Defined in: [src/async-semaphore.ts:195](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L195)
|
|
223
223
|
|
|
224
224
|
#### Parameters
|
|
225
225
|
|
|
@@ -237,7 +237,7 @@ Defined in: [src/async-semaphore.ts:199](https://github.com/isdk/util.js/blob/61
|
|
|
237
237
|
|
|
238
238
|
> **abort**(`reason?`): `void`
|
|
239
239
|
|
|
240
|
-
Defined in: [src/async-semaphore.ts:
|
|
240
|
+
Defined in: [src/async-semaphore.ts:306](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L306)
|
|
241
241
|
|
|
242
242
|
#### Parameters
|
|
243
243
|
|
|
@@ -255,7 +255,7 @@ Defined in: [src/async-semaphore.ts:301](https://github.com/isdk/util.js/blob/61
|
|
|
255
255
|
|
|
256
256
|
> **acquire**(`options?`): `Promise`\<[`BinarySemaphoreReleaserFunc`](../interfaces/BinarySemaphoreReleaserFunc.md)\>
|
|
257
257
|
|
|
258
|
-
Defined in: [src/async-semaphore.ts:
|
|
258
|
+
Defined in: [src/async-semaphore.ts:244](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L244)
|
|
259
259
|
|
|
260
260
|
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.
|
|
261
261
|
|
|
@@ -277,7 +277,7 @@ A promise that resolves to a release function when a token is acquired. If the s
|
|
|
277
277
|
|
|
278
278
|
> **drain**(): `Promise`\<`any`[]\>
|
|
279
279
|
|
|
280
|
-
Defined in: [src/async-semaphore.ts:
|
|
280
|
+
Defined in: [src/async-semaphore.ts:301](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L301)
|
|
281
281
|
|
|
282
282
|
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.
|
|
283
283
|
|
|
@@ -291,7 +291,7 @@ Drains the semaphore and returns all the initialized tokens in an array. Drainin
|
|
|
291
291
|
|
|
292
292
|
> **init**(`options`): `void`
|
|
293
293
|
|
|
294
|
-
Defined in: [src/async-semaphore.ts:
|
|
294
|
+
Defined in: [src/async-semaphore.ts:189](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L189)
|
|
295
295
|
|
|
296
296
|
#### Parameters
|
|
297
297
|
|
|
@@ -309,7 +309,7 @@ Defined in: [src/async-semaphore.ts:193](https://github.com/isdk/util.js/blob/61
|
|
|
309
309
|
|
|
310
310
|
> **initFree**(`options?`): `void`
|
|
311
311
|
|
|
312
|
-
Defined in: [src/async-semaphore.ts:
|
|
312
|
+
Defined in: [src/async-semaphore.ts:169](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L169)
|
|
313
313
|
|
|
314
314
|
#### Parameters
|
|
315
315
|
|
|
@@ -327,7 +327,7 @@ Defined in: [src/async-semaphore.ts:173](https://github.com/isdk/util.js/blob/61
|
|
|
327
327
|
|
|
328
328
|
> **lock**(`options?`): `any`
|
|
329
329
|
|
|
330
|
-
Defined in: [src/async-semaphore.ts:
|
|
330
|
+
Defined in: [src/async-semaphore.ts:218](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L218)
|
|
331
331
|
|
|
332
332
|
#### Parameters
|
|
333
333
|
|
|
@@ -345,7 +345,7 @@ Defined in: [src/async-semaphore.ts:217](https://github.com/isdk/util.js/blob/61
|
|
|
345
345
|
|
|
346
346
|
> **onReleased**(`options?`): `void`
|
|
347
347
|
|
|
348
|
-
Defined in: [src/async-semaphore.ts:
|
|
348
|
+
Defined in: [src/async-semaphore.ts:173](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L173)
|
|
349
349
|
|
|
350
350
|
#### Parameters
|
|
351
351
|
|
|
@@ -363,7 +363,7 @@ Defined in: [src/async-semaphore.ts:177](https://github.com/isdk/util.js/blob/61
|
|
|
363
363
|
|
|
364
364
|
> **release**(`options?`): `void`
|
|
365
365
|
|
|
366
|
-
Defined in: [src/async-semaphore.ts:
|
|
366
|
+
Defined in: [src/async-semaphore.ts:293](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L293)
|
|
367
367
|
|
|
368
368
|
Releases the semaphore, incrementing the number of free execution slots. If there are tasks in the waiting queue, the next task will be dispatched.
|
|
369
369
|
|
|
@@ -383,7 +383,7 @@ Releases the semaphore, incrementing the number of free execution slots. If ther
|
|
|
383
383
|
|
|
384
384
|
> **tryAcquire**(`options?`): `any`
|
|
385
385
|
|
|
386
|
-
Defined in: [src/async-semaphore.ts:
|
|
386
|
+
Defined in: [src/async-semaphore.ts:235](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L235)
|
|
387
387
|
|
|
388
388
|
Attempt to acquire a token from the semaphore, if one is available immediately. Otherwise, return undefined.
|
|
389
389
|
|
|
@@ -405,7 +405,7 @@ Returns a token if the semaphore is not full; otherwise, returns `undefined`.
|
|
|
405
405
|
|
|
406
406
|
> **unlock**(`token?`): `void`
|
|
407
407
|
|
|
408
|
-
Defined in: [src/async-semaphore.ts:
|
|
408
|
+
Defined in: [src/async-semaphore.ts:226](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/async-semaphore.ts#L226)
|
|
409
409
|
|
|
410
410
|
#### Parameters
|
|
411
411
|
|
|
@@ -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/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/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/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/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:
|
|
58
|
+
Defined in: [src/config-file.ts:142](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/config-file.ts#L142)
|
|
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:
|
|
107
|
+
Defined in: [src/config-file.ts:91](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/config-file.ts#L91)
|
|
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/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/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:
|
|
184
|
+
Defined in: [src/config-file.ts:108](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/config-file.ts#L108)
|
|
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/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/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/61856e5b1bbb9
|
|
|
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/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/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:
|
|
249
|
+
Defined in: [src/deque.ts:171](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/deque.ts#L171)
|
|
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/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/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:
|
|
854
|
+
Defined in: [src/deque.ts:175](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/deque.ts#L175)
|
|
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/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/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/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/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/61856e5b1bbb
|
|
|
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/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/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/61856e5b1bbb
|
|
|
1083
1083
|
|
|
1084
1084
|
> **pop**(`skipNull?`): `T` \| `undefined`
|
|
1085
1085
|
|
|
1086
|
-
Defined in: [src/deque.ts:
|
|
1086
|
+
Defined in: [src/deque.ts:101](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/deque.ts#L101)
|
|
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/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/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/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/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:
|
|
1379
|
+
Defined in: [src/deque.ts:141](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/deque.ts#L141)
|
|
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/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/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/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/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,
|
|
@@ -18,7 +18,7 @@ where the flag value 0 represents the 0th bit, 1 represents the 1st bit, and so
|
|
|
18
18
|
|
|
19
19
|
> **new IntSet**(`bitField?`): `IntSet`
|
|
20
20
|
|
|
21
|
-
Defined in: [src/intset.ts:
|
|
21
|
+
Defined in: [src/intset.ts:20](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/intset.ts#L20)
|
|
22
22
|
|
|
23
23
|
#### Parameters
|
|
24
24
|
|
|
@@ -36,7 +36,7 @@ Defined in: [src/intset.ts:21](https://github.com/isdk/util.js/blob/61856e5b1bbb
|
|
|
36
36
|
|
|
37
37
|
> **add**(`flag`): `IntSet`
|
|
38
38
|
|
|
39
|
-
Defined in: [src/intset.ts:
|
|
39
|
+
Defined in: [src/intset.ts:28](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/intset.ts#L28)
|
|
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:
|
|
62
|
+
Defined in: [src/intset.ts:56](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/intset.ts#L56)
|
|
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:
|
|
76
|
+
Defined in: [src/intset.ts:38](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/intset.ts#L38)
|
|
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:
|
|
98
|
+
Defined in: [src/intset.ts:49](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/intset.ts#L49)
|
|
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:
|
|
122
|
+
Defined in: [src/intset.ts:69](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/intset.ts#L69)
|
|
123
123
|
|
|
124
124
|
#### Returns
|
|
125
125
|
|
|
@@ -131,7 +131,7 @@ Defined in: [src/intset.ts:70](https://github.com/isdk/util.js/blob/61856e5b1bbb
|
|
|
131
131
|
|
|
132
132
|
> **toString**(): `string`
|
|
133
133
|
|
|
134
|
-
Defined in: [src/intset.ts:
|
|
134
|
+
Defined in: [src/intset.ts:65](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/intset.ts#L65)
|
|
135
135
|
|
|
136
136
|
#### Returns
|
|
137
137
|
|
|
@@ -143,7 +143,7 @@ Defined in: [src/intset.ts:66](https://github.com/isdk/util.js/blob/61856e5b1bbb
|
|
|
143
143
|
|
|
144
144
|
> **valueOf**(): `number`
|
|
145
145
|
|
|
146
|
-
Defined in: [src/intset.ts:
|
|
146
|
+
Defined in: [src/intset.ts:61](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/intset.ts#L61)
|
|
147
147
|
|
|
148
148
|
#### Returns
|
|
149
149
|
|
|
@@ -155,7 +155,7 @@ Defined in: [src/intset.ts:62](https://github.com/isdk/util.js/blob/61856e5b1bbb
|
|
|
155
155
|
|
|
156
156
|
> `static` **add**(`bitField`, `flag`): `number`
|
|
157
157
|
|
|
158
|
-
Defined in: [src/intset.ts:
|
|
158
|
+
Defined in: [src/intset.ts:11](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/intset.ts#L11)
|
|
159
159
|
|
|
160
160
|
#### Parameters
|
|
161
161
|
|
|
@@ -177,7 +177,7 @@ Defined in: [src/intset.ts:12](https://github.com/isdk/util.js/blob/61856e5b1bbb
|
|
|
177
177
|
|
|
178
178
|
> `static` **delete**(`bitField`, `flag`): `number`
|
|
179
179
|
|
|
180
|
-
Defined in: [src/intset.ts:
|
|
180
|
+
Defined in: [src/intset.ts:15](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/intset.ts#L15)
|
|
181
181
|
|
|
182
182
|
#### Parameters
|
|
183
183
|
|
|
@@ -199,7 +199,7 @@ Defined in: [src/intset.ts:16](https://github.com/isdk/util.js/blob/61856e5b1bbb
|
|
|
199
199
|
|
|
200
200
|
> `static` **has**(`bitField`, `flag`): `boolean`
|
|
201
201
|
|
|
202
|
-
Defined in: [src/intset.ts:
|
|
202
|
+
Defined in: [src/intset.ts:7](https://github.com/isdk/util.js/blob/20d48780d60e0a0a6f6a696a3efdfa46d4cb3b1e/src/intset.ts#L7)
|
|
203
203
|
|
|
204
204
|
#### Parameters
|
|
205
205
|
|