@gesslar/toolkit 5.7.0 → 5.9.0

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.
Files changed (62) hide show
  1. package/package.json +6 -6
  2. package/src/node/lib/Cache.js +70 -18
  3. package/src/node/lib/Data.js +35 -18
  4. package/src/node/lib/FileObject.js +3 -2
  5. package/types/browser/index.d.ts +6 -3
  6. package/types/browser/index.d.ts.map +1 -1
  7. package/types/browser/lib/Collection.d.ts +9 -2
  8. package/types/browser/lib/Collection.d.ts.map +1 -1
  9. package/types/browser/lib/Data.d.ts +21 -7
  10. package/types/browser/lib/Data.d.ts.map +1 -1
  11. package/types/browser/lib/Disposer.d.ts +2 -2
  12. package/types/browser/lib/Disposer.d.ts.map +1 -1
  13. package/types/browser/lib/HTML.d.ts +2 -2
  14. package/types/browser/lib/HTML.d.ts.map +1 -1
  15. package/types/browser/lib/Notify.d.ts +16 -16
  16. package/types/browser/lib/Notify.d.ts.map +1 -1
  17. package/types/browser/lib/Promised.d.ts +10 -10
  18. package/types/browser/lib/Promised.d.ts.map +1 -1
  19. package/types/browser/lib/Sass.d.ts +40 -28
  20. package/types/browser/lib/Sass.d.ts.map +1 -1
  21. package/types/browser/lib/Tantrum.d.ts +26 -16
  22. package/types/browser/lib/Tantrum.d.ts.map +1 -1
  23. package/types/browser/lib/Time.d.ts.map +1 -1
  24. package/types/browser/lib/TypeSpec.d.ts +33 -23
  25. package/types/browser/lib/TypeSpec.d.ts.map +1 -1
  26. package/types/browser/lib/Util.d.ts.map +1 -1
  27. package/types/browser/lib/Valid.d.ts +14 -11
  28. package/types/browser/lib/Valid.d.ts.map +1 -1
  29. package/types/browser/lib/vendor/dompurify.esm.d.ts +11 -23
  30. package/types/browser/lib/vendor/dompurify.esm.d.ts.map +1 -1
  31. package/types/node/index.d.ts +4 -2
  32. package/types/node/index.d.ts.map +1 -1
  33. package/types/node/lib/Cache.d.ts +63 -8
  34. package/types/node/lib/Cache.d.ts.map +1 -1
  35. package/types/node/lib/Data.d.ts +16 -6
  36. package/types/node/lib/Data.d.ts.map +1 -1
  37. package/types/node/lib/DirectoryObject.d.ts +111 -69
  38. package/types/node/lib/DirectoryObject.d.ts.map +1 -1
  39. package/types/node/lib/FileObject.d.ts +53 -23
  40. package/types/node/lib/FileObject.d.ts.map +1 -1
  41. package/types/node/lib/FileSystem.d.ts +63 -53
  42. package/types/node/lib/FileSystem.d.ts.map +1 -1
  43. package/types/node/lib/Font.d.ts +5 -5
  44. package/types/node/lib/Font.d.ts.map +1 -1
  45. package/types/node/lib/Glog.d.ts +157 -145
  46. package/types/node/lib/Glog.d.ts.map +1 -1
  47. package/types/node/lib/Notify.d.ts +18 -12
  48. package/types/node/lib/Notify.d.ts.map +1 -1
  49. package/types/node/lib/Sass.d.ts +14 -2
  50. package/types/node/lib/Sass.d.ts.map +1 -1
  51. package/types/node/lib/Tantrum.d.ts +18 -1
  52. package/types/node/lib/Tantrum.d.ts.map +1 -1
  53. package/types/node/lib/Term.d.ts +1 -2
  54. package/types/node/lib/Term.d.ts.map +1 -1
  55. package/types/node/lib/Util.d.ts +3 -11
  56. package/types/node/lib/Util.d.ts.map +1 -1
  57. package/types/node/lib/Valid.d.ts +8 -2
  58. package/types/node/lib/Valid.d.ts.map +1 -1
  59. package/types/node/lib/Watcher.d.ts +4 -4
  60. package/types/node/lib/Watcher.d.ts.map +1 -1
  61. package/vendor/toolkit.esm.js +1 -1
  62. package/vendor/toolkit.umd.js +1 -1
@@ -1,28 +1,22 @@
1
+ /**
2
+ * @file Sass.js
3
+ *
4
+ * Defines the Sass class, a custom error type for toolkit compilation
5
+ * errors.
6
+ *
7
+ * Supports error chaining, trace management, and formatted reporting for both
8
+ * user-friendly and verbose (nerd) output.
9
+ *
10
+ * Used throughout the toolkit for structured error handling and
11
+ * debugging.
12
+ */
13
+ import Tantrum from "./Tantrum.js";
1
14
  /**
2
15
  * Custom error class for toolkit errors.
3
16
  * Provides error chaining, trace management, and formatted error reporting.
4
17
  */
5
18
  export default class Sass extends Error {
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;
19
+ #private;
26
20
  /**
27
21
  * Creates a new Sass instance.
28
22
  *
@@ -30,18 +24,18 @@ export default class Sass extends Error {
30
24
  * @param {...unknown} [arg] - Additional arguments passed to parent Error constructor
31
25
  */
32
26
  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
27
  /**
40
28
  * Gets the error trace array.
41
29
  *
42
30
  * @returns {Array<string>} Array of trace messages
43
31
  */
44
32
  get trace(): Array<string>;
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);
45
39
  /**
46
40
  * Adds a trace message and returns this instance for chaining.
47
41
  *
@@ -57,7 +51,25 @@ export default class Sass extends Error {
57
51
  * @param {boolean} [isNested] - Whether this is a nested error report
58
52
  */
59
53
  report(nerdMode?: boolean, isNested?: boolean): void;
60
- #private;
54
+ /**
55
+ * Creates an Sass from an existing Error object with additional
56
+ * trace message.
57
+ *
58
+ * @param {Error} error - The original error object
59
+ * @param {string} message - Additional trace message to add
60
+ * @returns {Sass} New Sass instance with trace from the original error
61
+ * @throws {Sass} If the first parameter is not an Error instance
62
+ */
63
+ static from(error: Error, message: string): Sass;
64
+ /**
65
+ * Factory method to create or enhance Sass instances.
66
+ * If error parameter is provided, enhances existing Sass or wraps
67
+ * other errors. Otherwise creates a new Sass instance.
68
+ *
69
+ * @param {string} message - The error message
70
+ * @param {Error|Sass|Tantrum} [error] - Optional existing error to wrap or enhance
71
+ * @returns {Sass} New or enhanced Sass instance
72
+ */
73
+ static new(message: string, error?: Error | Sass | Tantrum): Sass;
61
74
  }
62
- import Tantrum from "./Tantrum.js";
63
75
  //# sourceMappingURL=Sass.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Sass.d.ts","sourceRoot":"","sources":["../../../src/browser/lib/Sass.js"],"names":[],"mappings":"AAeA;;;GAGG;AACH;IA8HE;;;;;;;;OAQG;IACH,mBALW,KAAK,WACL,MAAM,GACJ,IAAI,CAahB;IAED;;;;;;;;OAQG;IACH,sBAJW,MAAM,UACN,KAAK,GAAC,IAAI,GAAC,OAAO,GAChB,IAAI,CAchB;IArKD;;;;;OAKG;IACH,qBAHW,MAAM,WACH,OAAO,EAAA,EAMpB;IAWD;;;;OAIG;IACH,mBAFW,MAAM,EAIhB;IAhBD;;;;OAIG;IACH,aAFa,KAAK,CAAC,MAAM,CAAC,CAIzB;IAWD;;;;;OAKG;IACH,kBAHW,MAAM,GACJ,IAAI,CAShB;IAED;;;;;;OAMG;IACH,kBAHW,OAAO,aACP,OAAO,QAuCjB;;CA6EF;oBA/KmB,cAAc"}
1
+ {"version":3,"file":"Sass.d.ts","sourceRoot":"","sources":["../../../src/browser/lib/Sass.js"],"names":[],"mappings":"AAAA;;;;;;;;;;;GAWG;AAEH,OAAO,OAAO,MAAM,cAAc,CAAA;AAElC;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,KAAK;;IAGrC;;;;;OAKG;IACH,YAAY,OAAO,EAHR,MAGQ,EAAE,GAAG,GAAG,AAFxB,CACF,EADa,OAAO,EAEM,EAI1B;IAED;;;;OAIG;IACH,IAAI,KAAK,IAFI,KAAK,CAAC,MAAM,CAAC,CAIzB;IAED;;;;OAIG;IACH,IAAI,KAAK,CAAC,OAAO,EAFN,MAEM,EAEhB;IAED;;;;;OAKG;IACH,QAAQ,CAAC,OAAO,EAHL,MAGK,GAFH,IAAI,CAShB;IAED;;;;;;OAMG;IACH,MAAM,CAAC,QAAQ,AAHZ,CACA,EADQ,OAGU,EAAE,QAAQ,AAF5B,CACF,EADU,OAE0B,QAqCpC;IAkCD;;;;;;;;OAQG;IACH,MAAM,CAAC,IAAI,CAAC,KAAK,EALN,KAKM,EAAE,OAAO,EAJf,MAIe,GAHb,IAAI,CAahB;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,GAAG,CAAC,OAAO,EAJP,MAIO,EAAE,KAAK,AAHtB,CACA,EADQ,KAAK,GAAC,IAAI,GAAC,OAGG,GAFZ,IAAI,CAchB;CACF"}
@@ -1,16 +1,20 @@
1
+ /**
2
+ * @file Tantrum.js
3
+ *
4
+ * Defines the Tantrum class, a custom AggregateError type for toolkit
5
+ * that collects multiple errors with Sass-style reporting.
6
+ *
7
+ * Auto-wraps plain Error objects in Sass instances while preserving
8
+ * existing Sass errors, providing consistent formatted output for
9
+ * multiple error scenarios.
10
+ */
11
+ import Sass from "./Sass.js";
1
12
  /**
2
13
  * Custom aggregate error class that extends AggregateError.
3
14
  * Automatically wraps plain errors in Sass instances for consistent reporting.
4
15
  */
5
16
  export default class Tantrum extends AggregateError {
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;
17
+ #private;
14
18
  /**
15
19
  * Creates a new Tantrum instance.
16
20
  *
@@ -27,18 +31,18 @@ export default class Tantrum extends AggregateError {
27
31
  * @returns {this} This Tantrum instance for method chaining
28
32
  */
29
33
  addTrace(message: string, _error?: Error | Sass): this;
30
- /**
31
- * Adds a message to the beginning of the trace array.
32
- *
33
- * @param {string} message - The trace message to add
34
- */
35
- set trace(message: string);
36
34
  /**
37
35
  * Gets the error trace array.
38
36
  *
39
37
  * @returns {Array<string>} Array of trace messages
40
38
  */
41
39
  get trace(): Array<string>;
40
+ /**
41
+ * Adds a message to the beginning of the trace array.
42
+ *
43
+ * @param {string} message - The trace message to add
44
+ */
45
+ set trace(message: string);
42
46
  /**
43
47
  * Reports all aggregated errors to the console with formatted output.
44
48
  *
@@ -46,7 +50,13 @@ export default class Tantrum extends AggregateError {
46
50
  * @param {boolean} [isNested] - Whether this is a nested error report
47
51
  */
48
52
  report(nerdMode?: boolean, isNested?: boolean): void;
49
- #private;
53
+ /**
54
+ * Factory method to create a Tantrum instance.
55
+ *
56
+ * @param {string} message - The aggregate error message
57
+ * @param {Array<Error|Sass>} errors - Array of errors to aggregate
58
+ * @returns {Tantrum} New Tantrum instance
59
+ */
60
+ static new(message: string, errors?: Array<Error | Sass>): Tantrum;
50
61
  }
51
- import Sass from "./Sass.js";
52
62
  //# sourceMappingURL=Tantrum.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Tantrum.d.ts","sourceRoot":"","sources":["../../../src/browser/lib/Tantrum.js"],"names":[],"mappings":"AAaA;;;GAGG;AACH;IAwFE;;;;;;OAMG;IACH,sBAJW,MAAM,WACN,KAAK,CAAC,KAAK,GAAC,IAAI,CAAC,GACf,OAAO,CAOnB;IAhGD;;;;;;OAMG;IACH,qBAJW,MAAM,WACN,KAAK,CAAC,KAAK,GAAC,IAAI,CAAC,SACjB,IAAI,EAkBd;IAED;;;;;;OAMG;IACH,kBAJW,MAAM,WACN,KAAK,GAAC,IAAI,GACR,IAAI,CAShB;IAWD;;;;OAIG;IACH,mBAFW,MAAM,EAIhB;IAhBD;;;;OAIG;IACH,aAFa,KAAK,CAAC,MAAM,CAAC,CAIzB;IAWD;;;;;OAKG;IACH,kBAHW,OAAO,aACP,OAAO,QAmBjB;;CAeF;iBA3GgB,WAAW"}
1
+ {"version":3,"file":"Tantrum.d.ts","sourceRoot":"","sources":["../../../src/browser/lib/Tantrum.js"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAA;AAE5B;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,OAAQ,SAAQ,cAAc;;IAIjD;;;;;;OAMG;IACH,YAAY,OAAO,EAJR,MAIQ,EAAE,MAAM,GAHhB,KAAK,CAAC,KAAK,GAAC,IAAI,CAGK,EAAE,IAAI,GAF3B,IAEgC,EAgB1C;IAED;;;;;;OAMG;IACH,QAAQ,CAAC,OAAO,EAJL,MAIK,EAAE,MAAM,AAHrB,CACA,EADQ,KAAK,GAAC,IAGO,GAFX,IAAI,CAShB;IAED;;;;OAIG;IACH,IAAI,KAAK,IAFI,KAAK,CAAC,MAAM,CAAC,CAIzB;IAED;;;;OAIG;IACH,IAAI,KAAK,CAAC,OAAO,EAFN,MAEM,EAEhB;IAED;;;;;OAKG;IACH,MAAM,CAAC,QAAQ,AAHZ,CACA,EADQ,OAGY,EAAE,QAAQ,AAF9B,CACF,EADU,OAE8B,QAiBxC;IAED;;;;;;OAMG;IACH,MAAM,CAAC,GAAG,CAAC,OAAO,EAJP,MAIO,EAAE,MAAM,GAHf,KAAK,CAAC,KAAK,GAAC,IAAI,CAGI,GAFlB,OAAO,CAOnB;CACF"}
@@ -1 +1 @@
1
- {"version":3,"file":"Time.d.ts","sourceRoot":"","sources":["../../../src/browser/lib/Time.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH;IACE;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,oBAzBW,MAAM,UACN,OAAO,GACL,OAAO,CAAC,OAAO,CAAC,GAAG;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,CA0ChD;IAED;;;;;;;;;OASG;IACH,uBANW,OAAO,CAAC,OAAO,CAAC,GAAG;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAAC,GACnC,IAAI,CAQhB;CACF"}
1
+ {"version":3,"file":"Time.d.ts","sourceRoot":"","sources":["../../../src/browser/lib/Time.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,IAAI;IACvB;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACH,MAAM,CAAC,KAAK,CAAC,KAAK,EAzBP,MAyBO,EAAE,KAAK,AAxBtB,CACA,EADQ,OAwBc,GAvBZ,OAAO,CAAC,OAAO,CAAC,GAAG;QAAC,OAAO,EAAE,MAAM,CAAA;KAAC,CA0ChD;IAED;;;;;;;;;OASG;IACH,MAAM,CAAC,MAAM,CAAC,OAAO,EANV,OAAO,CAAC,OAAO,CAAC,GAAG;QAAC,OAAO,CAAC,EAAE,MAAM,CAAA;KAM1B,GALR,IAAI,CAQhB;CACF"}
@@ -1,17 +1,29 @@
1
+ /**
2
+ * @file Type specification and validation utilities.
3
+ * Provides TypeSpec class for parsing and validating complex type specifications
4
+ * including arrays, unions, and options.
5
+ */
6
+ export type TypeMatchOptions = {
7
+ /**
8
+ * - Permit a spec of {@link Data.emptyableTypes} to be empty
9
+ */
10
+ allowEmpty?: boolean;
11
+ };
1
12
  /**
2
13
  * Type specification class for parsing and validating complex type definitions.
3
14
  * Supports union types, array types, and validation options.
4
15
  */
5
16
  export default class TypeSpec {
17
+ #private;
18
+ specs: any;
19
+ length: any;
20
+ stringRepresentation: string;
6
21
  /**
7
22
  * Creates a new TypeSpec instance.
8
23
  *
9
24
  * @param {string} string - The type specification string (e.g., "string|number", "object[]")
10
25
  */
11
26
  constructor(string: string);
12
- specs: any[];
13
- length: number;
14
- stringRepresentation: string;
15
27
  /**
16
28
  * Returns a string representation of the type specification.
17
29
  *
@@ -29,35 +41,35 @@ export default class TypeSpec {
29
41
  *
30
42
  * @param {function(unknown): void} callback - Function to execute for each spec
31
43
  */
32
- forEach(callback: (arg0: unknown) => void): void;
44
+ forEach(callback: Function): void;
33
45
  /**
34
46
  * Tests whether all type specifications pass the provided test function.
35
47
  *
36
48
  * @param {function(unknown): boolean} callback - Function to test each spec
37
49
  * @returns {boolean} True if all specs pass the test
38
50
  */
39
- every(callback: (arg0: unknown) => boolean): boolean;
51
+ every(callback: Function): boolean;
40
52
  /**
41
53
  * Tests whether at least one type specification passes the provided test function.
42
54
  *
43
55
  * @param {function(unknown): boolean} callback - Function to test each spec
44
56
  * @returns {boolean} True if at least one spec passes the test
45
57
  */
46
- some(callback: (arg0: unknown) => boolean): boolean;
58
+ some(callback: Function): boolean;
47
59
  /**
48
60
  * Creates a new array with all type specifications that pass the provided test function.
49
61
  *
50
62
  * @param {function(unknown): boolean} callback - Function to test each spec
51
63
  * @returns {Array<unknown>} New array with filtered specs
52
64
  */
53
- filter(callback: (arg0: unknown) => boolean): Array<unknown>;
65
+ filter(callback: Function): Array<unknown>;
54
66
  /**
55
67
  * Creates a new array populated with the results of calling the provided function on every spec.
56
68
  *
57
69
  * @param {function(unknown): unknown} callback - Function to call on each spec
58
70
  * @returns {Array<unknown>} New array with mapped values
59
71
  */
60
- map(callback: (arg0: unknown) => unknown): Array<unknown>;
72
+ map(callback: Function): Array<unknown>;
61
73
  /**
62
74
  * Executes a reducer function on each spec, resulting in a single output value.
63
75
  *
@@ -65,14 +77,14 @@ export default class TypeSpec {
65
77
  * @param {unknown} initialValue - Initial value for the accumulator
66
78
  * @returns {unknown} The final accumulated value
67
79
  */
68
- reduce(callback: (arg0: unknown, arg1: unknown) => unknown, initialValue: unknown): unknown;
80
+ reduce(callback: Function, initialValue: unknown): unknown;
69
81
  /**
70
82
  * Returns the first type specification that satisfies the provided testing function.
71
83
  *
72
84
  * @param {function(unknown): boolean} callback - Function to test each spec
73
85
  * @returns {object|undefined} The first spec that matches, or undefined
74
86
  */
75
- find(callback: (arg0: unknown) => boolean): object | undefined;
87
+ find(callback: Function): object | undefined;
76
88
  /**
77
89
  * Tests whether a value matches any of the type specifications.
78
90
  * Handles array types, union types, and empty value validation.
@@ -81,12 +93,7 @@ export default class TypeSpec {
81
93
  * @param {TypeMatchOptions} [options] - Validation options
82
94
  * @returns {boolean} True if the value matches any type specification
83
95
  */
84
- matches(value: unknown, options?: {
85
- /**
86
- * - Permit a spec of {@link Data.emptyableTypes} to be empty
87
- */
88
- allowEmpty?: boolean;
89
- }): boolean;
96
+ matches(value: unknown, options?: TypeMatchOptions): boolean;
90
97
  /**
91
98
  * Options that can be passed to {@link TypeSpec.match}
92
99
  *
@@ -100,12 +107,15 @@ export default class TypeSpec {
100
107
  * @param {TypeMatchOptions} [options] - Validation options
101
108
  * @returns {Array<object>} Array of matching type specifications
102
109
  */
103
- match(value: unknown, { allowEmpty, }?: {
104
- /**
105
- * - Permit a spec of {@link Data.emptyableTypes} to be empty
106
- */
107
- allowEmpty?: boolean;
108
- }): Array<object>;
109
- #private;
110
+ match(value: unknown, { allowEmpty, }?: TypeMatchOptions): Array<object>;
111
+ /**
112
+ * Parses a type specification string into individual type specs.
113
+ * Handles union types separated by delimiters and array notation.
114
+ *
115
+ * @private
116
+ * @param {string} string - The type specification string to parse
117
+ * @throws {Sass} If the type specification is invalid
118
+ */
119
+ private #parse;
110
120
  }
111
121
  //# sourceMappingURL=TypeSpec.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"TypeSpec.d.ts","sourceRoot":"","sources":["../../../src/browser/lib/TypeSpec.js"],"names":[],"mappings":"AAWA;;;GAGG;AACH;IAGE;;;;OAIG;IACH,oBAFW,MAAM,EAUhB;IAJC,aAAwB;IACxB,eAAgC;IAChC,6BAA2C;IAI7C;;;;OAIG;IACH,YAFa,MAAM,CAkBlB;IAED;;;;OAIG;IACH,UAFa,OAAO,CASnB;IAED;;;;OAIG;IACH,kBAFW,CAAS,IAAO,EAAP,OAAO,KAAG,IAAI,QAIjC;IAED;;;;;OAKG;IACH,gBAHW,CAAS,IAAO,EAAP,OAAO,KAAG,OAAO,GACxB,OAAO,CAInB;IAED;;;;;OAKG;IACH,eAHW,CAAS,IAAO,EAAP,OAA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K,CAAC,MAAM,CAAC,cACb,MAAM,GACJ,MAAM,CAwBlB;IAED,mEAkBC;IAED;;;;MAqCC;CACF"}
1
+ {"version":3,"file":"Util.d.ts","sourceRoot":"","sources":["../../../src/browser/lib/Util.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,IAAI;IACvB;;;;;OAKG;IACH,MAAM,CAAC,UAAU,CAAC,IAAI,EAHX,MAGW,GAFT,MAAM,CAYlB;IAED;;;;;;OAMG;IACH,OAAa,IAAI,CAJJ,CAAC,EAII,EAAE,EAHT,MAAM,OAAO,CAAC,CAAC,CAGN,GAFP,OAAO,CAAC;QAAC,MAAM,EAAE,CAAC,CAAC;QAAC,IAAI,EAAE,MAAM,CAAA;KAAC,CAAC,CAQ9C;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,cAAc,CAAC,IAAI,EAJf,MAAM,GAAC,MAIQ,EAAE,KAAK,GAHtB,MAGyB,GAFvB,MAAM,CAWlB;IAED;;;;;;;OAOG;IACH,MAAM,CAAC,eAAe,CAAC,IAAI,EAJhB,MAAM,GAAC,MAIS,EAAE,KAAK,GAHvB,MAG0B,GAFxB,MAAM,CAalB;IAED;;;;;;OAMG;IACH,MAAM,CAAC,mBAAmB,CAAC,CAAC,EAJjB,MAIiB,EAAE,CAAC,EAHpB,MAGoB,GAFlB,MAAM,CAsBlB;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,gBAAgB,CAAC,KAAK,EALlB,MAKkB,EAAE,aAAa,EAJjC,KAAK,CAAC,MAAM,CAIqB,EAAE,SAAS,AAHpD,CACA,EADQ,MAG8C,GAF5C,MAAM,CAwBlB;IAED,MAAM,CAAC,QAAQ,CAAC,KAAK,KAAA,EAAE,IAAI,UAAK,EAAE,KAAK,QAAG,UAkBzC;IAED,MAAM,CAAC,MAAM;;;;MAqCZ;CACF"}
@@ -1,3 +1,16 @@
1
+ /**
2
+ * @file Valid.js
3
+ *
4
+ * Provides validation utilities for type checking and assertion.
5
+ * Includes prototype pollution protection for secure object manipulation.
6
+ */
7
+ import Sass from "./Sass.js";
8
+ export type TypeValidationOptions = {
9
+ /**
10
+ * - Whether empty values are allowed
11
+ */
12
+ allowEmpty?: boolean;
13
+ };
1
14
  /**
2
15
  * Options for type validation methods.
3
16
  *
@@ -8,6 +21,7 @@
8
21
  * Validation utility class providing type checking and assertion methods.
9
22
  */
10
23
  export default class Valid {
24
+ #private;
11
25
  /** @type {typeof Sass} */
12
26
  static _Sass: typeof Sass;
13
27
  /**
@@ -28,7 +42,6 @@ export default class Valid {
28
42
  * met (optional)
29
43
  */
30
44
  static assert(condition: boolean, message: string, arg?: number): void;
31
- static #restrictedProto: readonly string[];
32
45
  /**
33
46
  * Protects against prototype pollution by checking keys for dangerous property names.
34
47
  * Throws if any restricted prototype properties are found in the keys array.
@@ -38,14 +51,4 @@ export default class Valid {
38
51
  */
39
52
  static prototypePollutionProtection(keys: Array<string>): void;
40
53
  }
41
- /**
42
- * Options for type validation methods.
43
- */
44
- export type TypeValidationOptions = {
45
- /**
46
- * - Whether empty values are allowed
47
- */
48
- allowEmpty?: boolean;
49
- };
50
- import Sass from "./Sass.js";
51
54
  //# sourceMappingURL=Valid.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Valid.d.ts","sourceRoot":"","sources":["../../../src/browser/lib/Valid.js"],"names":[],"mappings":"AAWA;;;;;GAKG;AAEH;;GAEG;AACH;IACE,0BAA0B;IAC1B,cADW,OAAO,IAAI,CACH;IAEnB;;;;;;OAMG;IACH,mBAJW,OAAO,QACP,MAAM,YACN,qBAAqB,QAY/B;IAED;;;;;;;;OAQG;IACH,yBANW,OAAO,WACP,MAAM,QAEN,MAAM,QAehB;IAED,2CAAkF;IAElF;;;;;;OAMG;IACH,0CAHW,KAAK,CAAC,MAAM,CAAC,QAcvB;CACF;;;;;;;;iBAzEa,OAAO;;iBARJ,WAAW"}
1
+ {"version":3,"file":"Valid.d.ts","sourceRoot":"","sources":["../../../src/browser/lib/Valid.js"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,OAAO,IAAI,MAAM,WAAW,CAAA;AAOzB,YAAkB,qBAAqB,GACvC;;;;IAAqB,UAAU,AAA/B,CACF,EADa,OAAO,CACpB;CAAA,CAAA;AALD;;;;;GAKG;AAEH;;GAEG;AACH,MAAM,CAAC,OAAO,OAAO,KAAK;;IACxB,0BAA0B;IAC1B,MAAM,CAAC,KAAK,EADD,OAAO,IAAI,CACH;IAEnB;;;;;;OAMG;IACH,MAAM,CAAC,IAAI,CAAC,KAAK,EAJN,OAIM,EAAE,IAAI,EAHZ,MAGY,EAAE,OAAO,AAF7B,CACF,EADU,qBAEqB,QAU/B;IAED;;;;;;;;OAQG;IACH,MAAM,CAAC,MAAM,CAAC,SAAS,EANZ,OAMY,EAAE,OAAO,EALrB,MAKqB,EAAE,GAAG,AAHlC,CAEF,EAFU,MAGiC,QAY3C;IAID;;;;;;OAMG;IACH,MAAM,CAAC,4BAA4B,CAAC,IAAI,EAH7B,KAAK,CAAC,MAAM,CAGiB,QAWvC;CACF"}
@@ -1,29 +1,17 @@
1
- export { purify as default };
2
- declare function purify(root: any): {
1
+ /*! @license DOMPurify 3.3.0 | (c) Cure53 and other contributors | Released under the Apache license 2.0 and Mozilla Public License 2.0 | github.com/cure53/DOMPurify/blob/3.3.0/LICENSE */
2
+ declare var purify: {
3
3
  (root: any): /*elided*/ any;
4
4
  version: string;
5
5
  removed: any[];
6
6
  isSupported: boolean;
7
- sanitize(dirty: any, ...args: any[]): any;
8
- setConfig(...args: any[]): void;
9
- clearConfig(): void;
10
- isValidAttribute(tag: any, attr: any, value: any): boolean;
11
- addHook(entryPoint: any, hookFunction: any): void;
12
- removeHook(entryPoint: any, hookFunction: any): any;
13
- removeHooks(entryPoint: any): void;
14
- removeAllHooks(): void;
7
+ sanitize: (dirty: any) => any;
8
+ setConfig: () => void;
9
+ clearConfig: () => void;
10
+ isValidAttribute: (tag: any, attr: any, value: any) => boolean;
11
+ addHook: (entryPoint: any, hookFunction: any) => void;
12
+ removeHook: (entryPoint: any, hookFunction: any) => any;
13
+ removeHooks: (entryPoint: any) => void;
14
+ removeAllHooks: () => void;
15
15
  };
16
- declare namespace purify {
17
- let version: string;
18
- let removed: any[];
19
- let isSupported: boolean;
20
- function sanitize(dirty: any, ...args: any[]): any;
21
- function setConfig(...args: any[]): void;
22
- function clearConfig(): void;
23
- function isValidAttribute(tag: any, attr: any, value: any): boolean;
24
- function addHook(entryPoint: any, hookFunction: any): void;
25
- function removeHook(entryPoint: any, hookFunction: any): any;
26
- function removeHooks(entryPoint: any): void;
27
- function removeAllHooks(): void;
28
- }
16
+ export { purify as default };
29
17
  //# sourceMappingURL=dompurify.esm.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"dompurify.esm.d.ts","sourceRoot":"","sources":["../../../../src/browser/lib/vendor/dompurify.esm.js"],"names":[],"mappings":";AA0UE;;;;;;;;;;;;;EAA+C;;;;;IA+9B/C,mDAiJC;IACD,yCAIC;IACD,6BAGC;IACD,oEAUC;IACD,2DAMC;IACD,6DAQC;IACD,4CAEC;IACD,gCAEC"}
1
+ {"version":3,"file":"dompurify.esm.d.ts","sourceRoot":"","sources":["../../../../src/browser/lib/vendor/dompurify.esm.js"],"names":[],"mappings":"AAAA,2LAA2L;AAw+C3L,QAAA,IAAI,MAAM;;;;;;;;;;;;;CAAoB,CAAA;AAE9B,OAAO,EAAC,MAAM,IAAI,OAAO,EAAC,CAAA"}
@@ -1,5 +1,7 @@
1
1
  export { default as Collection } from "../browser/lib/Collection.js";
2
2
  export { default as Data } from "./lib/Data.js";
3
+ export { default as Disposer } from "../browser/lib/Disposer.js";
4
+ export { Disposer as DisposerClass } from "../browser/lib/Disposer.js";
3
5
  export { default as Promised } from "../browser/lib/Promised.js";
4
6
  export { default as Time } from "../browser/lib/Time.js";
5
7
  export { default as Type } from "../browser/lib/TypeSpec.js";
@@ -13,8 +15,8 @@ export { default as FileObject } from "./lib/FileObject.js";
13
15
  export { default as FileSystem } from "./lib/FileSystem.js";
14
16
  export { default as Font } from "./lib/Font.js";
15
17
  export { default as Glog } from "./lib/Glog.js";
18
+ export { default as Notify } from "./lib/Notify.js";
19
+ export { Notify as NotifyClass } from "./lib/Notify.js";
16
20
  export { default as Term } from "./lib/Term.js";
17
- export { default as Disposer, Disposer as DisposerClass } from "../browser/lib/Disposer.js";
18
- export { default as Notify, Notify as NotifyClass } from "./lib/Notify.js";
19
21
  export { default as Watcher, OverFlowBehaviour } from "./lib/Watcher.js";
20
22
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.js"],"names":[],"mappings":""}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/node/index.js"],"names":[],"mappings":"AACA,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,8BAA8B,CAAA;AAClE,OAAO,EAAC,OAAO,IAAI,IAAI,EAAC,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAC,OAAO,IAAI,QAAQ,EAAC,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAC,QAAQ,IAAI,aAAa,EAAC,MAAM,4BAA4B,CAAA;AACpE,OAAO,EAAC,OAAO,IAAI,QAAQ,EAAC,MAAM,4BAA4B,CAAA;AAC9D,OAAO,EAAC,OAAO,IAAI,IAAI,EAAC,MAAM,wBAAwB,CAAA;AACtD,OAAO,EAAC,OAAO,IAAI,IAAI,EAAC,MAAM,4BAA4B,CAAA;AAC1D,OAAO,EAAC,OAAO,IAAI,KAAK,EAAC,MAAM,gBAAgB,CAAA;AAG/C,OAAO,EAAC,OAAO,IAAI,IAAI,EAAC,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAC,OAAO,IAAI,OAAO,EAAC,MAAM,kBAAkB,CAAA;AACnD,OAAO,EAAC,OAAO,IAAI,IAAI,EAAC,MAAM,eAAe,CAAA;AAG7C,OAAO,EAAC,OAAO,IAAI,KAAK,EAAC,MAAM,gBAAgB,CAAA;AAC/C,OAAO,EAAC,OAAO,IAAI,eAAe,EAAC,MAAM,0BAA0B,CAAA;AACnE,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAC,OAAO,IAAI,UAAU,EAAC,MAAM,qBAAqB,CAAA;AACzD,OAAO,EAAC,OAAO,IAAI,IAAI,EAAC,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAC,OAAO,IAAI,IAAI,EAAC,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAC,OAAO,IAAI,MAAM,EAAC,MAAM,iBAAiB,CAAA;AACjD,OAAO,EAAC,MAAM,IAAI,WAAW,EAAC,MAAM,iBAAiB,CAAA;AACrD,OAAO,EAAC,OAAO,IAAI,IAAI,EAAC,MAAM,eAAe,CAAA;AAC7C,OAAO,EAAC,OAAO,IAAI,OAAO,EAAE,iBAAiB,EAAC,MAAM,kBAAkB,CAAA"}
@@ -1,3 +1,10 @@
1
+ import type FileObject from "./FileObject.js";
2
+ export type CacheDataType = "raw" | "structured";
3
+ export type CacheData = {
4
+ modified: Date;
5
+ raw: string | null;
6
+ structured: unknown;
7
+ };
1
8
  /**
2
9
  * @import FileObject from "./FileObject.js"
3
10
  */
@@ -17,6 +24,62 @@
17
24
  * through modification time checking.
18
25
  */
19
26
  export default class Cache {
27
+ #private;
28
+ /**
29
+ * Removes cached data for a specific file from the #cache map.
30
+ * Used when files are modified or when cache consistency needs to be
31
+ * maintained.
32
+ *
33
+ * @private
34
+ * @param {FileObject} file - The file object to remove from cache
35
+ * @returns {undefined}
36
+ */
37
+ private #cleanup;
38
+ /**
39
+ * Internal cache loader that reads raw content via FileObject and
40
+ * optionally parses it, using mtime-based invalidation to serve cached
41
+ * results when possible.
42
+ *
43
+ * @private
44
+ * @param {FileObject} fileObject - The file object to load
45
+ * @param {CacheDataType} kind - Whether to return "raw" text or
46
+ * "structured" parsed data
47
+ * @param {object} [options] - Options forwarded to read/parse
48
+ * @param {string} [options.encoding="utf8"] - File encoding
49
+ * @param {string} [options.type="any"] - Data format for parsing
50
+ * @returns {Promise<unknown>} The cached or freshly loaded data
51
+ * @throws {Sass} If the file does not exist
52
+ */
53
+ private #loadFromCache;
54
+ /**
55
+ * Resolves the cache record for a file at a given modification time,
56
+ * reading from disk when no record exists or the existing one is stale.
57
+ *
58
+ * Concurrent callers asking for the same file at the same mtime share a
59
+ * single read, and a record only enters the map once its contents are in
60
+ * hand. Without both of those, a second caller arriving while the first is
61
+ * still awaiting the read would find a record already stamped with the new
62
+ * mtime but still holding the previous revision's data, and happily return
63
+ * it as fresh.
64
+ *
65
+ * @private
66
+ * @param {FileObject} fileObject - The file object to resolve
67
+ * @param {Date} lastModified - The file's current modification time
68
+ * @param {object} options - Options forwarded to read
69
+ * @returns {Promise<CacheData>} The populated cache record
70
+ */
71
+ private #record;
72
+ /**
73
+ * Reads a file from disk and publishes it as a cache record.
74
+ *
75
+ * @private
76
+ * @param {FileObject} fileObject - The file object to read
77
+ * @param {Date} lastModified - The modification time the read represents
78
+ * @param {object} options - Options forwarded to read
79
+ * @param {string} [options.encoding="utf8"] - File encoding
80
+ * @returns {Promise<CacheData>} The freshly populated cache record
81
+ */
82
+ private #read;
20
83
  /**
21
84
  * Loads and caches parsed file data with automatic invalidation based on
22
85
  * modification time.
@@ -46,13 +109,5 @@ export default class Cache {
46
109
  * @param {import("./FileObject.js").default} file - The file object to clear from cache
47
110
  */
48
111
  resetCache(file: import("./FileObject.js").default): void;
49
- #private;
50
112
  }
51
- export type CacheDataType = "raw" | "structured";
52
- export type CacheData = {
53
- modified: Date;
54
- raw: string | null;
55
- structured: unknown;
56
- };
57
- import type FileObject from "./FileObject.js";
58
113
  //# sourceMappingURL=Cache.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Cache.d.ts","sourceRoot":"","sources":["../../../src/node/lib/Cache.js"],"names":[],"mappings":"AAIA;;GAEG;AAEH;;GAEG;AAEH;;GAEG;AAEH;;;;;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AAI,EAFJ,OAAO,iBAAiB,EAAE,OAEtB,QAId;CACF"}
@@ -1,19 +1,29 @@
1
+ import JSON5 from "json5";
2
+ import YAML from "yaml";
3
+ import BrowserData from "../../browser/lib/Data.js";
1
4
  /**
2
5
  * Node-side extension of Data with parsing utilities that require
3
6
  * node-specific dependencies.
4
7
  */
5
8
  export default class Data extends BrowserData {
9
+ static LOAD_DATA_TYPES: Readonly<{
10
+ json: readonly JSON[];
11
+ json5: readonly (typeof JSON5)[];
12
+ yaml: readonly (typeof YAML)[];
13
+ }>;
6
14
  /**
7
- * Parses text content as structured data (JSON5 or YAML).
15
+ * Parses text content as structured data (JSON, JSON5, or YAML).
16
+ *
17
+ * The `json` type uses strict JSON parsing and will NOT accept JSON5
18
+ * extensions (comments, trailing commas, unquoted keys); use `json5` for
19
+ * that. The `any` type tries each format from least to most permissive.
8
20
  *
9
21
  * @param {string} source - The text content to parse
10
- * @param {string} [type="any"] - The expected format ("json",
11
- * "json5", "yaml", or "any")
22
+ * @param {string} [type="any"] - The expected format ("json", "json5",
23
+ * "yaml", or "any")
12
24
  * @returns {unknown} The parsed data
13
- * @throws {Sass} If content cannot be parsed or type is
14
- * unsupported
25
+ * @throws {Sass} If content cannot be parsed or type is unsupported
15
26
  */
16
27
  static textAsData(source: string, type?: string): unknown;
17
28
  }
18
- import BrowserData from "../../browser/lib/Data.js";
19
29
  //# sourceMappingURL=Data.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"Data.d.ts","sourceRoot":"","sources":["../../../src/node/lib/Data.js"],"names":[],"mappings":"AAKA;;;GAGG;AACH;IACE;;;;;;;;;OASG;IACH,0BAPW,MAAM,SACN,MAAM,GAEJ,OAAO,CA+BnB;CACF;wBA9CuB,2BAA2B"}
1
+ {"version":3,"file":"Data.d.ts","sourceRoot":"","sources":["../../../src/node/lib/Data.js"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AACzB,OAAO,IAAI,MAAM,MAAM,CAAA;AACvB,OAAO,WAAW,MAAM,2BAA2B,CAAA;AAInD;;;GAGG;AACH,MAAM,CAAC,OAAO,OAAO,IAAK,SAAQ,WAAW;IAC3C,MAAM,CAAC,eAAe;;;;OAIpB;IAEF;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,UAAU,CAAC,MAAM,EANb,MAMa,EAAE,IAAI,AAL3B,CAEA,EAFQ,MAKyB,GAHvB,OAAO,CAqCnB;CACF"}