@gesslar/toolkit 0.8.0 → 1.0.2
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/README.md +39 -0
- package/package.json +22 -8
- package/src/browser/index.js +10 -0
- package/src/browser/lib/Sass.js +168 -0
- package/src/browser/lib/Tantrum.js +115 -0
- package/src/browser/lib/Util.js +257 -0
- package/src/browser/lib/Valid.js +76 -0
- package/src/index.js +14 -12
- package/src/lib/Cache.js +2 -3
- package/src/lib/Contract.js +3 -4
- package/src/lib/FS.js +15 -20
- package/src/lib/FileObject.js +1 -1
- package/src/lib/Glog.js +2 -2
- package/src/lib/Sass.js +2 -91
- package/src/lib/Schemer.js +2 -2
- package/src/lib/Tantrum.js +3 -70
- package/src/lib/Terms.js +2 -3
- package/src/lib/Util.js +2 -252
- package/src/lib/Valid.js +17 -20
- package/src/types/browser/index.d.ts +8 -0
- package/src/types/browser/index.d.ts.map +1 -0
- package/src/types/browser/lib/Collection.d.ts +246 -0
- package/src/types/browser/lib/Collection.d.ts.map +1 -0
- package/src/types/browser/lib/Data.d.ts +206 -0
- package/src/types/browser/lib/Data.d.ts.map +1 -0
- package/src/types/browser/lib/Sass.d.ts +62 -0
- package/src/types/browser/lib/Sass.d.ts.map +1 -0
- package/src/types/browser/lib/Tantrum.d.ts +51 -0
- package/src/types/browser/lib/Tantrum.d.ts.map +1 -0
- package/src/types/browser/lib/TypeSpec.d.ts +92 -0
- package/src/types/browser/lib/TypeSpec.d.ts.map +1 -0
- package/src/types/browser/lib/Util.d.ts +129 -0
- package/src/types/browser/lib/Util.d.ts.map +1 -0
- package/src/types/browser/lib/Valid.d.ts +33 -0
- package/src/types/browser/lib/Valid.d.ts.map +1 -0
- package/src/types/index.d.ts +10 -10
- package/src/types/lib/Cache.d.ts +2 -3
- package/src/types/lib/Cache.d.ts.map +1 -1
- package/src/types/lib/Contract.d.ts +3 -4
- package/src/types/lib/Contract.d.ts.map +1 -1
- package/src/types/lib/FS.d.ts +2 -2
- package/src/types/lib/FS.d.ts.map +1 -1
- package/src/types/lib/Sass.d.ts +2 -55
- package/src/types/lib/Sass.d.ts.map +1 -1
- package/src/types/lib/Tantrum.d.ts +3 -44
- package/src/types/lib/Tantrum.d.ts.map +1 -1
- package/src/types/lib/Terms.d.ts +2 -3
- package/src/types/lib/Terms.d.ts.map +1 -1
- package/src/types/lib/Util.d.ts +2 -123
- package/src/types/lib/Util.d.ts.map +1 -1
- package/src/types/lib/Valid.d.ts +1 -1
- package/src/types/lib/Valid.d.ts.map +1 -1
- /package/src/{lib → browser/lib}/Collection.js +0 -0
- /package/src/{lib → browser/lib}/Data.js +0 -0
- /package/src/{lib → browser/lib}/TypeSpec.js +0 -0
|
@@ -26,12 +26,12 @@ export default class Contract {
|
|
|
26
26
|
/**
|
|
27
27
|
* Creates a contract by negotiating between provider and consumer terms
|
|
28
28
|
*
|
|
29
|
-
* @param {Terms} providerTerms - What the provider offers
|
|
30
|
-
* @param {Terms} consumerTerms - What the consumer expects
|
|
29
|
+
* @param {import("./Terms.js").Terms} providerTerms - What the provider offers
|
|
30
|
+
* @param {import("./Terms.js").Terms} consumerTerms - What the consumer expects
|
|
31
31
|
* @param {object} options - Configuration options
|
|
32
32
|
* @param {import('../types.js').DebugFunction} [options.debug] - Debug function
|
|
33
33
|
*/
|
|
34
|
-
constructor(providerTerms: Terms, consumerTerms: Terms, { debug }?: {
|
|
34
|
+
constructor(providerTerms: import("./Terms.js").Terms, consumerTerms: import("./Terms.js").Terms, { debug }?: {
|
|
35
35
|
debug?: any;
|
|
36
36
|
});
|
|
37
37
|
/**
|
|
@@ -68,5 +68,4 @@ export default class Contract {
|
|
|
68
68
|
get validator(): (data: object) => boolean | null;
|
|
69
69
|
#private;
|
|
70
70
|
}
|
|
71
|
-
import Terms from "./Terms.js";
|
|
72
71
|
//# sourceMappingURL=Contract.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Contract.d.ts","sourceRoot":"","sources":["../../lib/Contract.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Contract.d.ts","sourceRoot":"","sources":["../../lib/Contract.js"],"names":[],"mappings":"AAIA;;;;GAIG;AACH;IAwBE;;;;;;;OAOG;IACH,oDAgBC;IAED;;;;;;;;OAQG;IACH,uBANW,MAAM,mBACN,MAAM,cACN,OAAO,KAAK,EAAE,gBAAgB,GAAC,IAAI,gBAEjC,QAAQ,CAsBpB;IAxED;;;;;;;OAOG;IACH,2BALW,OAAO,YAAY,EAAE,KAAK,iBAC1B,OAAO,YAAY,EAAE,KAAK,cAElC;QAAsD,KAAK,GAAnD,GAAmC;KAC7C,EAQA;IA6FD;;;;;;OAMG;IACH,eAJW,MAAM,GACJ,OAAO,CAsBnB;IAsED;;;;OAIG;IACH,oBAFa,OAAO,CAInB;IAED;;;;OAIG;IACH,qBAFa,KAAK,GAAC,IAAI,CAItB;IAED;;;;OAIG;IACH,qBAFa,KAAK,GAAC,IAAI,CAItB;IAED;;;;OAIG;IACH,iBAFa,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,GAAC,IAAI,CAI1C;;CACF"}
|
package/src/types/lib/FS.d.ts
CHANGED
|
@@ -65,6 +65,6 @@ export default class FS {
|
|
|
65
65
|
*/
|
|
66
66
|
static resolvePath(fromPath: string, toPath: string): string;
|
|
67
67
|
}
|
|
68
|
-
|
|
69
|
-
|
|
68
|
+
export type FileObject = import("./FileObject.js").default;
|
|
69
|
+
export type DirectoryObject = import("./DirectoryObject.js").default;
|
|
70
70
|
//# sourceMappingURL=FS.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"FS.d.ts","sourceRoot":"","sources":["../../lib/FS.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"FS.d.ts","sourceRoot":"","sources":["../../lib/FS.js"],"names":[],"mappings":"AAwBA;;GAEG;AACH;IACE,kCAAwB;IACxB,uCAAkC;IAClC,mBAAsB;IAEtB;;;;;OAKG;IACH,4BAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;OAKG;IACH,2BAHW,MAAM,GACJ,MAAM,CAUlB;IAED;;;;;OAKG;IACH,2BAHW,MAAM,GACJ,MAAM,CAQlB;IAED;;;;;;;OAOG;IACH,sBALW,MAAM,GAAC,KAAK,CAAC,MAAM,CAAC,GAClB,OAAO,CAAC,KAAK,CAAC,UAAU,CAAC,CAAC,CAmCtC;IAED;;;;;;;;;OASG;IACH,oCAJW,UAAU,GAAC,eAAe,MAC1B,UAAU,GAAC,eAAe,GACxB,MAAM,CAYlB;IAED;;;;;;;OAOG;IACH,oCALW,MAAM,SACN,MAAM,QACN,MAAM,GACJ,MAAM,CA2BlB;IAED;;;;;;;OAOG;IACH,6BAJW,MAAM,UACN,MAAM,GACJ,MAAM,CAgClB;CACF;yBAlMa,OAAO,iBAAiB,EAAE,OAAO;8BACjC,OAAO,sBAAsB,EAAE,OAAO"}
|
package/src/types/lib/Sass.d.ts
CHANGED
|
@@ -2,61 +2,8 @@
|
|
|
2
2
|
* Custom error class for toolkit errors.
|
|
3
3
|
* Provides error chaining, trace management, and formatted error reporting.
|
|
4
4
|
*/
|
|
5
|
-
export default class Sass extends
|
|
6
|
-
/**
|
|
7
|
-
* Creates an Sass from an existing Error object with additional
|
|
8
|
-
* trace message.
|
|
9
|
-
*
|
|
10
|
-
* @param {Error} error - The original error object
|
|
11
|
-
* @param {string} message - Additional trace message to add
|
|
12
|
-
* @returns {Sass} New Sass instance with trace from the original error
|
|
13
|
-
* @throws {Sass} If the first parameter is not an Error instance
|
|
14
|
-
*/
|
|
15
|
-
static from(error: Error, message: string): Sass;
|
|
16
|
-
/**
|
|
17
|
-
* Factory method to create or enhance Sass instances.
|
|
18
|
-
* If error parameter is provided, enhances existing Sass or wraps
|
|
19
|
-
* other errors. Otherwise creates a new Sass instance.
|
|
20
|
-
*
|
|
21
|
-
* @param {string} message - The error message
|
|
22
|
-
* @param {Error|Sass|Tantrum} [error] - Optional existing error to wrap or enhance
|
|
23
|
-
* @returns {Sass} New or enhanced Sass instance
|
|
24
|
-
*/
|
|
25
|
-
static "new"(message: string, error?: Error | Sass | Tantrum): Sass;
|
|
26
|
-
/**
|
|
27
|
-
* Creates a new Sass instance.
|
|
28
|
-
*
|
|
29
|
-
* @param {string} message - The error message
|
|
30
|
-
* @param {...unknown} [arg] - Additional arguments passed to parent Error constructor
|
|
31
|
-
*/
|
|
32
|
-
constructor(message: string, ...arg?: unknown[]);
|
|
33
|
-
/**
|
|
34
|
-
* Adds a message to the beginning of the trace array.
|
|
35
|
-
*
|
|
36
|
-
* @param {string} message - The trace message to add
|
|
37
|
-
*/
|
|
38
|
-
set trace(message: string);
|
|
39
|
-
/**
|
|
40
|
-
* Gets the error trace array.
|
|
41
|
-
*
|
|
42
|
-
* @returns {Array<string>} Array of trace messages
|
|
43
|
-
*/
|
|
44
|
-
get trace(): Array<string>;
|
|
45
|
-
/**
|
|
46
|
-
* Adds a trace message and returns this instance for chaining.
|
|
47
|
-
*
|
|
48
|
-
* @param {string} message - The trace message to add
|
|
49
|
-
* @returns {this} This Sass instance for method chaining
|
|
50
|
-
*/
|
|
51
|
-
addTrace(message: string): this;
|
|
52
|
-
/**
|
|
53
|
-
* Reports the error to the terminal with formatted output.
|
|
54
|
-
* Optionally includes detailed stack trace information.
|
|
55
|
-
*
|
|
56
|
-
* @param {boolean} [nerdMode] - Whether to include detailed stack trace
|
|
57
|
-
*/
|
|
58
|
-
report(nerdMode?: boolean): void;
|
|
5
|
+
export default class Sass extends BrowserSass {
|
|
59
6
|
#private;
|
|
60
7
|
}
|
|
61
|
-
import
|
|
8
|
+
import { Sass as BrowserSass } from "../browser/index.js";
|
|
62
9
|
//# sourceMappingURL=Sass.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Sass.d.ts","sourceRoot":"","sources":["../../lib/Sass.js"],"names":[],"mappings":"AAgBA;;;GAGG;AACH
|
|
1
|
+
{"version":3,"file":"Sass.d.ts","sourceRoot":"","sources":["../../lib/Sass.js"],"names":[],"mappings":"AAgBA;;;GAGG;AACH;;CA2DC;oCAlEiC,qBAAqB"}
|
|
@@ -2,49 +2,8 @@
|
|
|
2
2
|
* Custom aggregate error class that extends AggregateError.
|
|
3
3
|
* Automatically wraps plain errors in Sass instances for consistent reporting.
|
|
4
4
|
*/
|
|
5
|
-
export default class Tantrum extends
|
|
6
|
-
|
|
7
|
-
* Factory method to create a Tantrum instance.
|
|
8
|
-
*
|
|
9
|
-
* @param {string} message - The aggregate error message
|
|
10
|
-
* @param {Array<Error|Sass>} errors - Array of errors to aggregate
|
|
11
|
-
* @returns {Tantrum} New Tantrum instance
|
|
12
|
-
*/
|
|
13
|
-
static "new"(message: string, errors?: Array<Error | Sass>): Tantrum;
|
|
14
|
-
/**
|
|
15
|
-
* Creates a new Tantrum instance.
|
|
16
|
-
*
|
|
17
|
-
* @param {string} message - The aggregate error message
|
|
18
|
-
* @param {Array<Error|Sass>} errors - Array of errors to aggregate
|
|
19
|
-
*/
|
|
20
|
-
constructor(message: string, errors?: Array<Error | Sass>);
|
|
21
|
-
/**
|
|
22
|
-
* Adds a trace message and returns this instance for chaining.
|
|
23
|
-
*
|
|
24
|
-
* @param {string} message - The trace message to add
|
|
25
|
-
* @param {Error|Sass} [_error] - Optional error (currently unused, reserved for future use)
|
|
26
|
-
* @returns {this} This Tantrum instance for method chaining
|
|
27
|
-
*/
|
|
28
|
-
addTrace(message: string, _error?: Error | Sass): this;
|
|
29
|
-
/**
|
|
30
|
-
* Adds a message to the beginning of the trace array.
|
|
31
|
-
*
|
|
32
|
-
* @param {string} message - The trace message to add
|
|
33
|
-
*/
|
|
34
|
-
set trace(message: string);
|
|
35
|
-
/**
|
|
36
|
-
* Gets the error trace array.
|
|
37
|
-
*
|
|
38
|
-
* @returns {Array<string>} Array of trace messages
|
|
39
|
-
*/
|
|
40
|
-
get trace(): Array<string>;
|
|
41
|
-
/**
|
|
42
|
-
* Reports all aggregated errors to the terminal with formatted output.
|
|
43
|
-
*
|
|
44
|
-
* @param {boolean} [nerdMode] - Whether to include detailed stack traces
|
|
45
|
-
*/
|
|
46
|
-
report(nerdMode?: boolean): void;
|
|
47
|
-
#private;
|
|
5
|
+
export default class Tantrum extends BrowserTantrum {
|
|
6
|
+
constructor(message: any, errors?: any[]);
|
|
48
7
|
}
|
|
49
|
-
import
|
|
8
|
+
import { Tantrum as BrowserTantrum } from "../browser/index.js";
|
|
50
9
|
//# sourceMappingURL=Tantrum.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tantrum.d.ts","sourceRoot":"","sources":["../../lib/Tantrum.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Tantrum.d.ts","sourceRoot":"","sources":["../../lib/Tantrum.js"],"names":[],"mappings":"AAeA;;;GAGG;AACH;IACE,0CAEC;CAsBF;0CAjCuC,qBAAqB"}
|
package/src/types/lib/Terms.d.ts
CHANGED
|
@@ -7,10 +7,10 @@ export default class Terms {
|
|
|
7
7
|
* Parses terms data, handling file references
|
|
8
8
|
*
|
|
9
9
|
* @param {string|object} termsData - Terms data or reference
|
|
10
|
-
* @param {DirectoryObject?} directoryObject - Directory context for file resolution
|
|
10
|
+
* @param {import("./DirectoryObject.js").DirectoryObject?} directoryObject - Directory context for file resolution
|
|
11
11
|
* @returns {object} Parsed terms data
|
|
12
12
|
*/
|
|
13
|
-
static parse(termsData: string | object, directoryObject: DirectoryObject | null): object;
|
|
13
|
+
static parse(termsData: string | object, directoryObject: import("./DirectoryObject.js").DirectoryObject | null): object;
|
|
14
14
|
constructor(definition: any);
|
|
15
15
|
/**
|
|
16
16
|
* Get the terms definition
|
|
@@ -20,5 +20,4 @@ export default class Terms {
|
|
|
20
20
|
get definition(): object;
|
|
21
21
|
#private;
|
|
22
22
|
}
|
|
23
|
-
import DirectoryObject from "./DirectoryObject.js";
|
|
24
23
|
//# sourceMappingURL=Terms.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Terms.d.ts","sourceRoot":"","sources":["../../lib/Terms.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Terms.d.ts","sourceRoot":"","sources":["../../lib/Terms.js"],"names":[],"mappings":"AAUA;;;GAGG;AACH;IAOE;;;;;;OAMG;IACH,wBAJW,MAAM,GAAC,MAAM,mBACb,OAAO,sBAAsB,EAAE,eAAe,OAAC,GAC7C,MAAM,CAmClB;IA5CD,6BAEC;IA4CD;;;;OAIG;IACH,kBAFa,MAAM,CAIlB;;CAEF"}
|
package/src/types/lib/Util.d.ts
CHANGED
|
@@ -2,43 +2,7 @@
|
|
|
2
2
|
* Utility class providing common helper functions for string manipulation,
|
|
3
3
|
* timing, hashing, and option parsing.
|
|
4
4
|
*/
|
|
5
|
-
export default class Util {
|
|
6
|
-
/**
|
|
7
|
-
* Capitalizes the first letter of a string.
|
|
8
|
-
*
|
|
9
|
-
* @param {string} text - The text to capitalize
|
|
10
|
-
* @returns {string} Text with first letter capitalized
|
|
11
|
-
*/
|
|
12
|
-
static capitalize(text: string): string;
|
|
13
|
-
/**
|
|
14
|
-
* Measure wall-clock time for an async function.
|
|
15
|
-
*
|
|
16
|
-
* @template T
|
|
17
|
-
* @param {() => Promise<T>} fn - Thunk returning a promise.
|
|
18
|
-
* @returns {Promise<{result: T, cost: number}>} Object containing result and elapsed ms (number, 1 decimal).
|
|
19
|
-
*/
|
|
20
|
-
static time<T>(fn: () => Promise<T>): Promise<{
|
|
21
|
-
result: T;
|
|
22
|
-
cost: number;
|
|
23
|
-
}>;
|
|
24
|
-
/**
|
|
25
|
-
* Right-align a string inside a fixed width (left pad with spaces).
|
|
26
|
-
* If the string exceeds width it is returned unchanged.
|
|
27
|
-
*
|
|
28
|
-
* @param {string|number} text - Text to align.
|
|
29
|
-
* @param {number} width - Target field width (default 80).
|
|
30
|
-
* @returns {string} Padded string.
|
|
31
|
-
*/
|
|
32
|
-
static rightAlignText(text: string | number, width?: number): string;
|
|
33
|
-
/**
|
|
34
|
-
* Centre-align a string inside a fixed width (pad with spaces on left).
|
|
35
|
-
* If the string exceeds width it is returned unchanged.
|
|
36
|
-
*
|
|
37
|
-
* @param {string|number} text - Text to align.
|
|
38
|
-
* @param {number} width - Target field width (default 80).
|
|
39
|
-
* @returns {string} Padded string with text centred.
|
|
40
|
-
*/
|
|
41
|
-
static centreAlignText(text: string | number, width?: number): string;
|
|
5
|
+
export default class Util extends BrowserUtil {
|
|
42
6
|
/**
|
|
43
7
|
* Compute sha256 hash (hex) of the provided string.
|
|
44
8
|
*
|
|
@@ -71,73 +35,6 @@ export default class Util {
|
|
|
71
35
|
* @returns {Array<string>} Array of canonical option names (long preferred, short if no long present).
|
|
72
36
|
*/
|
|
73
37
|
static generateOptionNames(object: object): Array<string>;
|
|
74
|
-
/**
|
|
75
|
-
* Asynchronously awaits all promises in parallel.
|
|
76
|
-
* Wrapper around Promise.all for consistency with other utility methods.
|
|
77
|
-
*
|
|
78
|
-
* @param {Array<Promise<unknown>>} promises - Array of promises to await
|
|
79
|
-
* @returns {Promise<Array<unknown>>} Results of all promises
|
|
80
|
-
*/
|
|
81
|
-
static awaitAll(promises: Array<Promise<unknown>>): Promise<Array<unknown>>;
|
|
82
|
-
/**
|
|
83
|
-
* Settles all promises (both fulfilled and rejected) in parallel.
|
|
84
|
-
* Wrapper around Promise.allSettled for consistency with other utility methods.
|
|
85
|
-
*
|
|
86
|
-
* @param {Array<Promise<unknown>>} promises - Array of promises to settle
|
|
87
|
-
* @returns {Promise<Array<object>>} Results of all settled promises with status and value/reason
|
|
88
|
-
*/
|
|
89
|
-
static settleAll(promises: Array<Promise<unknown>>): Promise<Array<object>>;
|
|
90
|
-
/**
|
|
91
|
-
* Checks if any result in the settled promise array is rejected.
|
|
92
|
-
*
|
|
93
|
-
* @param {Array<object>} result - Array of settled promise results.
|
|
94
|
-
* @returns {boolean} True if any result is rejected, false otherwise.
|
|
95
|
-
*/
|
|
96
|
-
static anyRejected(result: Array<object>): boolean;
|
|
97
|
-
/**
|
|
98
|
-
* Filters and returns all rejected results from a settled promise array.
|
|
99
|
-
*
|
|
100
|
-
* @param {Array<object>} result - Array of settled promise results.
|
|
101
|
-
* @returns {Array<object>} Array of rejected results.
|
|
102
|
-
*/
|
|
103
|
-
static settledAndRejected(result: Array<object>): Array<object>;
|
|
104
|
-
/**
|
|
105
|
-
* Extracts the rejection reasons from an array of rejected promise results.
|
|
106
|
-
*
|
|
107
|
-
* @param {Array<object>} rejected - Array of rejected results.
|
|
108
|
-
* @returns {Array<unknown>} Array of rejection reasons.
|
|
109
|
-
*/
|
|
110
|
-
static rejectedReasons(rejected: Array<object>): Array<unknown>;
|
|
111
|
-
/**
|
|
112
|
-
* Throws a Sass error containing all rejection reasons from settled promises.
|
|
113
|
-
*
|
|
114
|
-
* @param {string} [_message] - Optional error message. Defaults to "GIGO"
|
|
115
|
-
* @param {Array<object>} rejected - Array of rejected results.
|
|
116
|
-
* @throws {Error} Throws a Sass error with rejection reasons.
|
|
117
|
-
*/
|
|
118
|
-
static throwRejected(_message?: string, rejected: Array<object>): void;
|
|
119
|
-
/**
|
|
120
|
-
* Filters and returns all fulfilled results from a settled promise array.
|
|
121
|
-
*
|
|
122
|
-
* @param {Array<object>} result - Array of settled promise results.
|
|
123
|
-
* @returns {Array<object>} Array of fulfilled results.
|
|
124
|
-
*/
|
|
125
|
-
static settledAndFulfilled(result: Array<object>): Array<object>;
|
|
126
|
-
/**
|
|
127
|
-
* Extracts the values from all fulfilled results in a settled promise array.
|
|
128
|
-
*
|
|
129
|
-
* @param {Array<object>} result - Array of settled promise results.
|
|
130
|
-
* @returns {Array<unknown>} Array of fulfilled values.
|
|
131
|
-
*/
|
|
132
|
-
static fulfilledValues(result: Array<object>): Array<unknown>;
|
|
133
|
-
/**
|
|
134
|
-
* Returns the first promise to resolve or reject from an array of promises.
|
|
135
|
-
* Wrapper around Promise.race for consistency with other utility methods.
|
|
136
|
-
*
|
|
137
|
-
* @param {Array<Promise<unknown>>} promises - Array of promises to race
|
|
138
|
-
* @returns {Promise<unknown>} Result of the first settled promise
|
|
139
|
-
*/
|
|
140
|
-
static race(promises: Array<Promise<unknown>>): Promise<unknown>;
|
|
141
38
|
/**
|
|
142
39
|
* Private method that performs the actual async emission logic.
|
|
143
40
|
* Handles listener execution, error aggregation, and result processing.
|
|
@@ -174,25 +71,7 @@ export default class Util {
|
|
|
174
71
|
* @returns {Promise<void>} Resolves when all listeners have completed, but no grapes.
|
|
175
72
|
*/
|
|
176
73
|
static asyncEmitQuack(emitter: object, event: string, ...args: unknown[]): Promise<void>;
|
|
177
|
-
/**
|
|
178
|
-
* Determine the Levenshtein distance between two string values
|
|
179
|
-
*
|
|
180
|
-
* @param {string} a The first value for comparison.
|
|
181
|
-
* @param {string} b The second value for comparison.
|
|
182
|
-
* @returns {number} The Levenshtein distance
|
|
183
|
-
*/
|
|
184
|
-
static levenshteinDistance(a: string, b: string): number;
|
|
185
|
-
/**
|
|
186
|
-
* Determine the closest match between a string and allowed values
|
|
187
|
-
* from the Levenshtein distance.
|
|
188
|
-
*
|
|
189
|
-
* @param {string} input The input string to resolve
|
|
190
|
-
* @param {Array<string>} allowedValues The values which are permitted
|
|
191
|
-
* @param {number} [threshold] Max edit distance for a "close match"
|
|
192
|
-
* @returns {string} Suggested, probable match.
|
|
193
|
-
*/
|
|
194
|
-
static findClosestMatch(input: string, allowedValues: Array<string>, threshold?: number): string;
|
|
195
|
-
static regexify(input: any, trim?: boolean, flags?: any[]): RegExp;
|
|
196
74
|
}
|
|
75
|
+
import { Util as BrowserUtil } from "../browser/index.js";
|
|
197
76
|
import { EventEmitter } from "node:events";
|
|
198
77
|
//# sourceMappingURL=Util.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Util.d.ts","sourceRoot":"","sources":["../../lib/Util.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Util.d.ts","sourceRoot":"","sources":["../../lib/Util.js"],"names":[],"mappings":"AAKA;;;GAGG;AACH;IACE;;;;;OAKG;IACH,iBAHW,MAAM,GACJ,MAAM,CAIlB;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,mCAHW,MAAM,GACJ,KAAK,CAAC,MAAM,CAAC,CAazB;IAED;;;;;;;;OAQG;IACH,+CALW,MAAM,SACN,MAAM,WACH,OAAO,EAAA,GACR,OAAO,CAAC,IAAI,CAAC,CAmBzB;IAED;;;;;;;;;;;;OAYG;IACH,0BALW,YAAY,SACZ,MAAM,WACH,OAAO,EAAA,GACR,OAAO,CAAC,IAAI,CAAC,CAqBzB;IAED;;;;;;;;;;OAUG;IACH,+BALW,MAAM,SACN,MAAM,WACH,OAAO,EAAA,GACR,OAAO,CAAC,IAAI,CAAC,CAyBzB;CACF;oCAvJiC,qBAAqB;6BAF5B,aAAa"}
|
package/src/types/lib/Valid.d.ts
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
* Validation utility class providing type checking and assertion methods.
|
|
3
3
|
*/
|
|
4
4
|
export default class Valid {
|
|
5
|
+
static "__#private@#restrictedProto": string[];
|
|
5
6
|
/**
|
|
6
7
|
* Validates a value against a type. Uses Data.isType.
|
|
7
8
|
*
|
|
@@ -20,7 +21,6 @@ export default class Valid {
|
|
|
20
21
|
* met (optional)
|
|
21
22
|
*/
|
|
22
23
|
static assert(condition: boolean, message: string, arg?: number): void;
|
|
23
|
-
static "__#private@#restrictedProto": string[];
|
|
24
24
|
/**
|
|
25
25
|
* Protects against prototype pollution by checking keys for dangerous property names.
|
|
26
26
|
* Throws if any restricted prototype properties are found in the keys array.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Valid.d.ts","sourceRoot":"","sources":["../../lib/Valid.js"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Valid.d.ts","sourceRoot":"","sources":["../../lib/Valid.js"],"names":[],"mappings":"AAWA;;GAEG;AACH;IACE,+CAAmE;IAEnE;;;;;;OAMG;IACH,mBAJW,OAAO,QACP,MAAM,YACN,MAAM,QAQhB;IAED;;;;;;;;OAQG;IACH,yBANW,OAAO,WACP,MAAM,QAEN,MAAM,QAkBhB;IAED;;;;;;OAMG;IACH,0CAHW,KAAK,CAAC,MAAM,CAAC,QAYvB;CACF"}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|