@isdk/util 0.3.2 → 0.3.3
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 +464 -1
- package/dist/index.d.ts +464 -1
- package/dist/index.js +1 -1
- package/dist/index.mjs +1 -1
- package/docs/classes/BinarySemaphore.md +418 -0
- package/docs/classes/ConfigFile.md +6 -6
- package/docs/classes/Deque.md +1912 -0
- package/docs/classes/IntSet.md +216 -0
- package/docs/classes/Semaphore.md +538 -0
- package/docs/classes/SignalGate.md +184 -0
- package/docs/functions/RateLimit.md +37 -0
- 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 +25 -0
- 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/parseFrontMatter.md +1 -1
- package/docs/functions/parseYaml.md +1 -1
- package/docs/functions/reControlCharsRegex.md +1 -1
- package/docs/functions/registerYamlTag.md +2 -2
- 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 +36 -0
- 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 +27 -0
- package/docs/globals.md +17 -0
- package/docs/interfaces/BinarySemaphoreAcquireOptions.md +25 -0
- package/docs/interfaces/BinarySemaphoreOptions.md +57 -0
- package/docs/interfaces/BinarySemaphoreReleaseOptions.md +25 -0
- package/docs/interfaces/BinarySemaphoreReleaserFunc.md +37 -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 +89 -0
- package/docs/interfaces/SemaphoreTaskItem.md +73 -0
- package/docs/type-aliases/SemaphoreIsReadyFuncType.md +15 -0
- 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 +11 -0
- package/docs/variables/FilenameReservedRegex.md +1 -1
- package/docs/variables/WindowsReservedNameRegex.md +1 -1
- package/package.json +3 -1
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
[**@isdk/util**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/util](../globals.md) / RateLimit
|
|
6
|
+
|
|
7
|
+
# Function: RateLimit()
|
|
8
|
+
|
|
9
|
+
> **RateLimit**(`rps`, `__namedParameters`): () => `Promise`\<`void`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [src/async-semaphore.ts:476](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/async-semaphore.ts#L476)
|
|
12
|
+
|
|
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
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### rps
|
|
18
|
+
|
|
19
|
+
`number`
|
|
20
|
+
|
|
21
|
+
### \_\_namedParameters
|
|
22
|
+
|
|
23
|
+
#### timeUnit?
|
|
24
|
+
|
|
25
|
+
`number` = `1000`
|
|
26
|
+
|
|
27
|
+
#### uniformDistribution?
|
|
28
|
+
|
|
29
|
+
`boolean` = `false`
|
|
30
|
+
|
|
31
|
+
## Returns
|
|
32
|
+
|
|
33
|
+
`Function`
|
|
34
|
+
|
|
35
|
+
### Returns
|
|
36
|
+
|
|
37
|
+
`Promise`\<`void`\>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **arrayHasAll**\<`T`\>(`array`, `elements`): `boolean`
|
|
10
10
|
|
|
11
|
-
Defined in: [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/f6ac1e1b241d01211870dd55d000c1e9d4daa404/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: [filename.ts:189](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/filename.ts:189](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/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: [filename.ts:42](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/filename.ts:42](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/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
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[**@isdk/util**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/util](../globals.md) / findPort
|
|
6
|
+
|
|
7
|
+
# Function: findPort()
|
|
8
|
+
|
|
9
|
+
> **findPort**(`port`, `portRetryCount`): `Promise`\<`number`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [src/find-port.ts:3](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/find-port.ts#L3)
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
### port
|
|
16
|
+
|
|
17
|
+
`string` | `number`
|
|
18
|
+
|
|
19
|
+
### portRetryCount
|
|
20
|
+
|
|
21
|
+
`number` = `10`
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`Promise`\<`number`\>
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **getMultiLevelExtname**(`filename`, `level`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [get-multi-level-extname.ts:9](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/get-multi-level-extname.ts:9](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/get-multi-level-extname.ts#L9)
|
|
12
12
|
|
|
13
13
|
Retrieves multi-level file extension
|
|
14
14
|
|
package/docs/functions/glob.md
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **glob**(`filepath`, `pattern`, `rootDir`?): `undefined` \| `boolean`
|
|
10
10
|
|
|
11
|
-
Defined in: [glob.ts:29](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/glob.ts:29](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/glob.ts#L29)
|
|
12
12
|
|
|
13
13
|
Matches a file path against a list of glob patterns.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **isStringIn**(`str`, `arr`): `boolean`
|
|
10
10
|
|
|
11
|
-
Defined in: [is-string-in.ts:17](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/is-string-in.ts:17](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/is-string-in.ts#L17)
|
|
12
12
|
|
|
13
13
|
Checks if a given string exists within an array of strings or a single string.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **isValidFilename**(`filename`): `boolean` \| `""`
|
|
10
10
|
|
|
11
|
-
Defined in: [filename.ts:63](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/filename.ts:63](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/filename.ts#L63)
|
|
12
12
|
|
|
13
13
|
Validates if a given string is a valid filename.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **isValidFilepath**(`filepath`): `boolean`
|
|
10
10
|
|
|
11
|
-
Defined in: [filename.ts:72](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/filename.ts:72](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/filename.ts#L72)
|
|
12
12
|
|
|
13
13
|
Validates whether the given filepath is valid.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **normalizeIncludeFiles**(`files`?, `defaultFiles`?): `string`[]
|
|
10
10
|
|
|
11
|
-
Defined in: [include-files.ts:34](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/include-files.ts:34](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/include-files.ts#L34)
|
|
12
12
|
|
|
13
13
|
Normalizes a list of file patterns for glob matching.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **parseFrontMatter**(`value`, `delimiter`): `object`
|
|
10
10
|
|
|
11
|
-
Defined in: [front-matter.ts:6](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/front-matter.ts:6](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/front-matter.ts#L6)
|
|
12
12
|
|
|
13
13
|
## Parameters
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **parseYaml**(`content`, `options`?): `any`
|
|
10
10
|
|
|
11
|
-
Defined in: [yaml.ts:51](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/yaml.ts:51](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/yaml.ts#L51)
|
|
12
12
|
|
|
13
13
|
Parses a YAML string into a JavaScript object with optional custom tags.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **reControlCharsRegex**(): `RegExp`
|
|
10
10
|
|
|
11
|
-
Defined in: [filename.ts:50](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/filename.ts:50](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/filename.ts#L50)
|
|
12
12
|
|
|
13
13
|
Returns a new regular expression instance for control characters in a filename with the 'g' flag.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **registerYamlTag**(`tags`): `void`
|
|
10
10
|
|
|
11
|
-
Defined in: [yaml.ts:23](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/yaml.ts:23](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/yaml.ts#L23)
|
|
12
12
|
|
|
13
13
|
Registers custom YAML tags to be used in parsing and stringifying YAML content.
|
|
14
14
|
|
|
@@ -18,7 +18,7 @@ Registers custom YAML tags to be used in parsing and stringifying YAML content.
|
|
|
18
18
|
|
|
19
19
|
A single tag or an array of tags to register.
|
|
20
20
|
|
|
21
|
-
`Tags` | `ScalarTag` | `CollectionTag` | `"binary"` | `"bool"` | `"float"` | `"floatExp"` | `"floatNaN"` | `"floatTime"` | `"int"` | `"intHex"` | `"intOct"` | `"intTime"` | `"
|
|
21
|
+
`"map"` | `Tags` | `ScalarTag` | `CollectionTag` | `"binary"` | `"bool"` | `"float"` | `"floatExp"` | `"floatNaN"` | `"floatTime"` | `"int"` | `"intHex"` | `"intOct"` | `"intTime"` | `"merge"` | `"null"` | `"omap"` | `"pairs"` | `"seq"` | `"set"` | `"timestamp"`
|
|
22
22
|
|
|
23
23
|
## Returns
|
|
24
24
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **removeLeadingEmptyLines**(`text`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [remove-leading-empty-lines.ts:16](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/remove-leading-empty-lines.ts:16](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/remove-leading-empty-lines.ts#L16)
|
|
12
12
|
|
|
13
13
|
Removes all leading empty lines or "#" comments line from the given string.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **sanitizeFilename**(`filename`, `options`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [filename.ts:97](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/filename.ts:97](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/filename.ts#L97)
|
|
12
12
|
|
|
13
13
|
Sanitizes a given filename by replacing invalid characters with a specified replacement character or a default.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **sanitizeFilepath**(`filepath`, `options`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [filename.ts:149](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/filename.ts:149](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/filename.ts#L149)
|
|
12
12
|
|
|
13
13
|
Sanitizes each part of a file path and reassembles it, ensuring the path is valid according to provided options.
|
|
14
14
|
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
[**@isdk/util**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/util](../globals.md) / sleep
|
|
6
|
+
|
|
7
|
+
# Function: sleep()
|
|
8
|
+
|
|
9
|
+
> **sleep**(`ms`): `Promise`\<`void`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [src/sleep.ts:12](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/sleep.ts#L12)
|
|
12
|
+
|
|
13
|
+
Suspends execution for a specified number of milliseconds
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
### ms
|
|
18
|
+
|
|
19
|
+
`number`
|
|
20
|
+
|
|
21
|
+
The number of milliseconds to pause execution
|
|
22
|
+
|
|
23
|
+
## Returns
|
|
24
|
+
|
|
25
|
+
`Promise`\<`void`\>
|
|
26
|
+
|
|
27
|
+
## Example
|
|
28
|
+
|
|
29
|
+
```ts
|
|
30
|
+
await sleep(500); // Pause for half a second
|
|
31
|
+
```
|
|
32
|
+
|
|
33
|
+
## Remarks
|
|
34
|
+
|
|
35
|
+
This implementation uses `setTimeout` under the hood and is more precise
|
|
36
|
+
for longer durations than `setImmediate`-based approaches
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **stringifyYaml**(`content`, `options`?): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [yaml.ts:85](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/yaml.ts:85](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/yaml.ts#L85)
|
|
12
12
|
|
|
13
13
|
Converts a JavaScript object into a YAML string with optional custom tags.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **toCamelCase**(`str`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [to-camel-case.ts:17](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/to-camel-case.ts:17](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/to-camel-case.ts#L17)
|
|
12
12
|
|
|
13
13
|
Converts a string to camelCase.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **toCapitalCase**(`str`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [to-capital-case.ts:17](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/to-capital-case.ts:17](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/to-capital-case.ts#L17)
|
|
12
12
|
|
|
13
13
|
Converts a string to capital case, where the first letter of each word is capitalized
|
|
14
14
|
and the rest are in lowercase. Words are separated by spaces, hyphens, or underscores.
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **toPascalCase**(`str`): `string`
|
|
10
10
|
|
|
11
|
-
Defined in: [to-pascal-case.ts:16](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/to-pascal-case.ts:16](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/to-pascal-case.ts#L16)
|
|
12
12
|
|
|
13
13
|
Converts a string to PascalCase.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **traverseFolder**(`directoryPath`, `fileHandler`): `Promise`\<`void`\>
|
|
10
10
|
|
|
11
|
-
Defined in: [traverse-folder.ts:38](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/traverse-folder.ts:38](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/traverse-folder.ts#L38)
|
|
12
12
|
|
|
13
13
|
Traverses a folder asynchronously and applies a handler to each file or directory.
|
|
14
14
|
|
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
|
|
9
9
|
> **traverseFolderSync**(`directoryPath`, `fileHandler`): `void`
|
|
10
10
|
|
|
11
|
-
Defined in: [traverse-folder.ts:76](https://github.com/isdk/util.js/blob/
|
|
11
|
+
Defined in: [src/traverse-folder.ts:76](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/traverse-folder.ts#L76)
|
|
12
12
|
|
|
13
13
|
Traverses a folder synchronously and applies a handler to each file or directory.
|
|
14
14
|
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
[**@isdk/util**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/util](../globals.md) / yieldExec
|
|
6
|
+
|
|
7
|
+
# Function: yieldExec()
|
|
8
|
+
|
|
9
|
+
> **yieldExec**(): `Promise`\<`void`\>
|
|
10
|
+
|
|
11
|
+
Defined in: [src/sleep.ts:28](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/sleep.ts#L28)
|
|
12
|
+
|
|
13
|
+
Yields execution control to the event loop, allowing pending I/O operations
|
|
14
|
+
and scheduled tasks to run before continuing.
|
|
15
|
+
|
|
16
|
+
## Returns
|
|
17
|
+
|
|
18
|
+
`Promise`\<`void`\>
|
|
19
|
+
|
|
20
|
+
## Remarks
|
|
21
|
+
|
|
22
|
+
This method creates a microtask checkpoint using `setImmediate`, which helps:
|
|
23
|
+
- Interleave CPU-intensive work with I/O events
|
|
24
|
+
- Prevent event loop blocking
|
|
25
|
+
- Maintain application responsiveness
|
|
26
|
+
|
|
27
|
+
Particularly useful for breaking up long synchronous operations in Node.js.
|
package/docs/globals.md
CHANGED
|
@@ -6,16 +6,28 @@
|
|
|
6
6
|
|
|
7
7
|
## Classes
|
|
8
8
|
|
|
9
|
+
- [BinarySemaphore](classes/BinarySemaphore.md)
|
|
9
10
|
- [ConfigFile](classes/ConfigFile.md)
|
|
11
|
+
- [Deque](classes/Deque.md)
|
|
12
|
+
- [IntSet](classes/IntSet.md)
|
|
13
|
+
- [Semaphore](classes/Semaphore.md)
|
|
14
|
+
- [SignalGate](classes/SignalGate.md)
|
|
10
15
|
|
|
11
16
|
## Interfaces
|
|
12
17
|
|
|
18
|
+
- [BinarySemaphoreAcquireOptions](interfaces/BinarySemaphoreAcquireOptions.md)
|
|
19
|
+
- [BinarySemaphoreOptions](interfaces/BinarySemaphoreOptions.md)
|
|
20
|
+
- [BinarySemaphoreReleaseOptions](interfaces/BinarySemaphoreReleaseOptions.md)
|
|
21
|
+
- [BinarySemaphoreReleaserFunc](interfaces/BinarySemaphoreReleaserFunc.md)
|
|
13
22
|
- [IncludeFiles](interfaces/IncludeFiles.md)
|
|
14
23
|
- [LoadConfigFileOptions](interfaces/LoadConfigFileOptions.md)
|
|
15
24
|
- [SanitizeFilenameOptions](interfaces/SanitizeFilenameOptions.md)
|
|
25
|
+
- [SemaphoreOptions](interfaces/SemaphoreOptions.md)
|
|
26
|
+
- [SemaphoreTaskItem](interfaces/SemaphoreTaskItem.md)
|
|
16
27
|
|
|
17
28
|
## Type Aliases
|
|
18
29
|
|
|
30
|
+
- [SemaphoreIsReadyFuncType](type-aliases/SemaphoreIsReadyFuncType.md)
|
|
19
31
|
- [StringifyFunc](type-aliases/StringifyFunc.md)
|
|
20
32
|
- [TraverseFolderHandler](type-aliases/TraverseFolderHandler.md)
|
|
21
33
|
- [TraverseFolderSyncHandler](type-aliases/TraverseFolderSyncHandler.md)
|
|
@@ -23,6 +35,7 @@
|
|
|
23
35
|
## Variables
|
|
24
36
|
|
|
25
37
|
- [DefaultAllTextFiles](variables/DefaultAllTextFiles.md)
|
|
38
|
+
- [DefaultAsyncSemaphoreCapacity](variables/DefaultAsyncSemaphoreCapacity.md)
|
|
26
39
|
- [FilenameReservedRegex](variables/FilenameReservedRegex.md)
|
|
27
40
|
- [WindowsReservedNameRegex](variables/WindowsReservedNameRegex.md)
|
|
28
41
|
|
|
@@ -31,6 +44,7 @@
|
|
|
31
44
|
- [arrayHasAll](functions/arrayHasAll.md)
|
|
32
45
|
- [extNameLevel](functions/extNameLevel.md)
|
|
33
46
|
- [filenameReservedRegex](functions/filenameReservedRegex.md)
|
|
47
|
+
- [findPort](functions/findPort.md)
|
|
34
48
|
- [getMultiLevelExtname](functions/getMultiLevelExtname.md)
|
|
35
49
|
- [glob](functions/glob.md)
|
|
36
50
|
- [isStringIn](functions/isStringIn.md)
|
|
@@ -39,14 +53,17 @@
|
|
|
39
53
|
- [normalizeIncludeFiles](functions/normalizeIncludeFiles.md)
|
|
40
54
|
- [parseFrontMatter](functions/parseFrontMatter.md)
|
|
41
55
|
- [parseYaml](functions/parseYaml.md)
|
|
56
|
+
- [RateLimit](functions/RateLimit.md)
|
|
42
57
|
- [reControlCharsRegex](functions/reControlCharsRegex.md)
|
|
43
58
|
- [registerYamlTag](functions/registerYamlTag.md)
|
|
44
59
|
- [removeLeadingEmptyLines](functions/removeLeadingEmptyLines.md)
|
|
45
60
|
- [sanitizeFilename](functions/sanitizeFilename.md)
|
|
46
61
|
- [sanitizeFilepath](functions/sanitizeFilepath.md)
|
|
62
|
+
- [sleep](functions/sleep.md)
|
|
47
63
|
- [stringifyYaml](functions/stringifyYaml.md)
|
|
48
64
|
- [toCamelCase](functions/toCamelCase.md)
|
|
49
65
|
- [toCapitalCase](functions/toCapitalCase.md)
|
|
50
66
|
- [toPascalCase](functions/toPascalCase.md)
|
|
51
67
|
- [traverseFolder](functions/traverseFolder.md)
|
|
52
68
|
- [traverseFolderSync](functions/traverseFolderSync.md)
|
|
69
|
+
- [yieldExec](functions/yieldExec.md)
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[**@isdk/util**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/util](../globals.md) / BinarySemaphoreAcquireOptions
|
|
6
|
+
|
|
7
|
+
# Interface: BinarySemaphoreAcquireOptions
|
|
8
|
+
|
|
9
|
+
Defined in: [src/async-semaphore.ts:28](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/async-semaphore.ts#L28)
|
|
10
|
+
|
|
11
|
+
## Extended by
|
|
12
|
+
|
|
13
|
+
- [`SemaphoreTaskItem`](SemaphoreTaskItem.md)
|
|
14
|
+
|
|
15
|
+
## Indexable
|
|
16
|
+
|
|
17
|
+
\[`n`: `string`\]: `any`
|
|
18
|
+
|
|
19
|
+
## Properties
|
|
20
|
+
|
|
21
|
+
### signal?
|
|
22
|
+
|
|
23
|
+
> `optional` **signal**: `AbortSignal`
|
|
24
|
+
|
|
25
|
+
Defined in: [src/async-semaphore.ts:29](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/async-semaphore.ts#L29)
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
[**@isdk/util**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/util](../globals.md) / BinarySemaphoreOptions
|
|
6
|
+
|
|
7
|
+
# Interface: BinarySemaphoreOptions
|
|
8
|
+
|
|
9
|
+
Defined in: [src/async-semaphore.ts:21](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/async-semaphore.ts#L21)
|
|
10
|
+
|
|
11
|
+
## Extended by
|
|
12
|
+
|
|
13
|
+
- [`SemaphoreOptions`](SemaphoreOptions.md)
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
### capacity?
|
|
18
|
+
|
|
19
|
+
> `optional` **capacity**: `number`
|
|
20
|
+
|
|
21
|
+
Defined in: [src/async-semaphore.ts:25](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/async-semaphore.ts#L25)
|
|
22
|
+
|
|
23
|
+
***
|
|
24
|
+
|
|
25
|
+
### initFn()?
|
|
26
|
+
|
|
27
|
+
> `optional` **initFn**: () => `any`
|
|
28
|
+
|
|
29
|
+
Defined in: [src/async-semaphore.ts:22](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/async-semaphore.ts#L22)
|
|
30
|
+
|
|
31
|
+
#### Returns
|
|
32
|
+
|
|
33
|
+
`any`
|
|
34
|
+
|
|
35
|
+
***
|
|
36
|
+
|
|
37
|
+
### pauseFn()?
|
|
38
|
+
|
|
39
|
+
> `optional` **pauseFn**: () => `void`
|
|
40
|
+
|
|
41
|
+
Defined in: [src/async-semaphore.ts:23](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/async-semaphore.ts#L23)
|
|
42
|
+
|
|
43
|
+
#### Returns
|
|
44
|
+
|
|
45
|
+
`void`
|
|
46
|
+
|
|
47
|
+
***
|
|
48
|
+
|
|
49
|
+
### resumeFn()?
|
|
50
|
+
|
|
51
|
+
> `optional` **resumeFn**: () => `void`
|
|
52
|
+
|
|
53
|
+
Defined in: [src/async-semaphore.ts:24](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/async-semaphore.ts#L24)
|
|
54
|
+
|
|
55
|
+
#### Returns
|
|
56
|
+
|
|
57
|
+
`void`
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
[**@isdk/util**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/util](../globals.md) / BinarySemaphoreReleaseOptions
|
|
6
|
+
|
|
7
|
+
# Interface: BinarySemaphoreReleaseOptions
|
|
8
|
+
|
|
9
|
+
Defined in: [src/async-semaphore.ts:33](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/async-semaphore.ts#L33)
|
|
10
|
+
|
|
11
|
+
## Extended by
|
|
12
|
+
|
|
13
|
+
- [`BinarySemaphoreReleaserFunc`](BinarySemaphoreReleaserFunc.md)
|
|
14
|
+
|
|
15
|
+
## Indexable
|
|
16
|
+
|
|
17
|
+
\[`n`: `string`\]: `any`
|
|
18
|
+
|
|
19
|
+
## Properties
|
|
20
|
+
|
|
21
|
+
### token?
|
|
22
|
+
|
|
23
|
+
> `optional` **token**: `any`
|
|
24
|
+
|
|
25
|
+
Defined in: [src/async-semaphore.ts:34](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/async-semaphore.ts#L34)
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
[**@isdk/util**](../README.md)
|
|
2
|
+
|
|
3
|
+
***
|
|
4
|
+
|
|
5
|
+
[@isdk/util](../globals.md) / BinarySemaphoreReleaserFunc
|
|
6
|
+
|
|
7
|
+
# Interface: BinarySemaphoreReleaserFunc()
|
|
8
|
+
|
|
9
|
+
Defined in: [src/async-semaphore.ts:38](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/async-semaphore.ts#L38)
|
|
10
|
+
|
|
11
|
+
## Extends
|
|
12
|
+
|
|
13
|
+
- [`BinarySemaphoreReleaseOptions`](BinarySemaphoreReleaseOptions.md)
|
|
14
|
+
|
|
15
|
+
> **BinarySemaphoreReleaserFunc**(): `void`
|
|
16
|
+
|
|
17
|
+
Defined in: [src/async-semaphore.ts:39](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/async-semaphore.ts#L39)
|
|
18
|
+
|
|
19
|
+
## Returns
|
|
20
|
+
|
|
21
|
+
`void`
|
|
22
|
+
|
|
23
|
+
## Indexable
|
|
24
|
+
|
|
25
|
+
\[`n`: `string`\]: `any`
|
|
26
|
+
|
|
27
|
+
## Properties
|
|
28
|
+
|
|
29
|
+
### token?
|
|
30
|
+
|
|
31
|
+
> `optional` **token**: `any`
|
|
32
|
+
|
|
33
|
+
Defined in: [src/async-semaphore.ts:34](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/async-semaphore.ts#L34)
|
|
34
|
+
|
|
35
|
+
#### Inherited from
|
|
36
|
+
|
|
37
|
+
[`BinarySemaphoreReleaseOptions`](BinarySemaphoreReleaseOptions.md).[`token`](BinarySemaphoreReleaseOptions.md#token)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: IncludeFiles
|
|
8
8
|
|
|
9
|
-
Defined in: [include-files.ts:6](https://github.com/isdk/util.js/blob/
|
|
9
|
+
Defined in: [src/include-files.ts:6](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/include-files.ts#L6)
|
|
10
10
|
|
|
11
11
|
## Properties
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ Defined in: [include-files.ts:6](https://github.com/isdk/util.js/blob/e52ad0627f
|
|
|
14
14
|
|
|
15
15
|
> `optional` **exclude**: `string`[]
|
|
16
16
|
|
|
17
|
-
Defined in: [include-files.ts:8](https://github.com/isdk/util.js/blob/
|
|
17
|
+
Defined in: [src/include-files.ts:8](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/include-files.ts#L8)
|
|
18
18
|
|
|
19
19
|
***
|
|
20
20
|
|
|
@@ -22,4 +22,4 @@ Defined in: [include-files.ts:8](https://github.com/isdk/util.js/blob/e52ad0627f
|
|
|
22
22
|
|
|
23
23
|
> `optional` **include**: `string`[]
|
|
24
24
|
|
|
25
|
-
Defined in: [include-files.ts:7](https://github.com/isdk/util.js/blob/
|
|
25
|
+
Defined in: [src/include-files.ts:7](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/include-files.ts#L7)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: LoadConfigFileOptions
|
|
8
8
|
|
|
9
|
-
Defined in: [config-file.ts:20](https://github.com/isdk/util.js/blob/
|
|
9
|
+
Defined in: [src/config-file.ts:20](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/config-file.ts#L20)
|
|
10
10
|
|
|
11
11
|
## Properties
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ Defined in: [config-file.ts:20](https://github.com/isdk/util.js/blob/e52ad0627fc
|
|
|
14
14
|
|
|
15
15
|
> `optional` **externalFile**: `string`
|
|
16
16
|
|
|
17
|
-
Defined in: [config-file.ts:22](https://github.com/isdk/util.js/blob/
|
|
17
|
+
Defined in: [src/config-file.ts:22](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/config-file.ts#L22)
|
|
18
18
|
|
|
19
19
|
***
|
|
20
20
|
|
|
@@ -22,4 +22,4 @@ Defined in: [config-file.ts:22](https://github.com/isdk/util.js/blob/e52ad0627fc
|
|
|
22
22
|
|
|
23
23
|
> `optional` **extLevel**: `number`
|
|
24
24
|
|
|
25
|
-
Defined in: [config-file.ts:21](https://github.com/isdk/util.js/blob/
|
|
25
|
+
Defined in: [src/config-file.ts:21](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/config-file.ts#L21)
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
# Interface: SanitizeFilenameOptions
|
|
8
8
|
|
|
9
|
-
Defined in: [filename.ts:83](https://github.com/isdk/util.js/blob/
|
|
9
|
+
Defined in: [src/filename.ts:83](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/filename.ts#L83)
|
|
10
10
|
|
|
11
11
|
## Properties
|
|
12
12
|
|
|
@@ -14,7 +14,7 @@ Defined in: [filename.ts:83](https://github.com/isdk/util.js/blob/e52ad0627fc33d
|
|
|
14
14
|
|
|
15
15
|
> `optional` **maxLength**: `number`
|
|
16
16
|
|
|
17
|
-
Defined in: [filename.ts:85](https://github.com/isdk/util.js/blob/
|
|
17
|
+
Defined in: [src/filename.ts:85](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/filename.ts#L85)
|
|
18
18
|
|
|
19
19
|
***
|
|
20
20
|
|
|
@@ -22,4 +22,4 @@ Defined in: [filename.ts:85](https://github.com/isdk/util.js/blob/e52ad0627fc33d
|
|
|
22
22
|
|
|
23
23
|
> `optional` **replacement**: `string`
|
|
24
24
|
|
|
25
|
-
Defined in: [filename.ts:84](https://github.com/isdk/util.js/blob/
|
|
25
|
+
Defined in: [src/filename.ts:84](https://github.com/isdk/util.js/blob/f6ac1e1b241d01211870dd55d000c1e9d4daa404/src/filename.ts#L84)
|