tyneq 1.0.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.
Files changed (52) hide show
  1. package/README.md +67 -1
  2. package/dist/{TyneqCachedTerminalOperator.d.ts → TyneqCachedTerminalOperator-BrW77zIy.d.ts} +328 -173
  3. package/dist/{TyneqCachedTerminalOperator.d.cts → TyneqCachedTerminalOperator-EaNiNt61.d.cts} +328 -173
  4. package/dist/chunk-5R4AALC7.js +680 -0
  5. package/dist/chunk-C5PBY3ZU.cjs +46 -0
  6. package/dist/chunk-OWKUE3AC.cjs +680 -0
  7. package/dist/chunk-PCBN5AFG.js +46 -0
  8. package/dist/chunk-VJAICXA6.cjs +3788 -0
  9. package/dist/chunk-ZP6WMZCK.js +3788 -0
  10. package/dist/core-C54TSmgW.d.cts +1390 -0
  11. package/dist/core-C54TSmgW.d.ts +1390 -0
  12. package/dist/index.cjs +638 -843
  13. package/dist/index.d.cts +405 -605
  14. package/dist/index.d.ts +405 -605
  15. package/dist/index.js +630 -781
  16. package/dist/plugin/index.cjs +51 -24
  17. package/dist/plugin/index.d.cts +35 -38
  18. package/dist/plugin/index.d.ts +35 -38
  19. package/dist/plugin/index.js +51 -2
  20. package/dist/utility/index.cjs +18 -9
  21. package/dist/utility/index.d.cts +312 -2
  22. package/dist/utility/index.d.ts +312 -2
  23. package/dist/utility/index.js +18 -3
  24. package/package.json +5 -5
  25. package/dist/Lazy.cjs +0 -762
  26. package/dist/Lazy.cjs.map +0 -1
  27. package/dist/Lazy.js +0 -691
  28. package/dist/Lazy.js.map +0 -1
  29. package/dist/TyneqCachedTerminalOperator.cjs +0 -4950
  30. package/dist/TyneqCachedTerminalOperator.cjs.map +0 -1
  31. package/dist/TyneqCachedTerminalOperator.d.cts.map +0 -1
  32. package/dist/TyneqCachedTerminalOperator.d.ts.map +0 -1
  33. package/dist/TyneqCachedTerminalOperator.js +0 -4741
  34. package/dist/TyneqCachedTerminalOperator.js.map +0 -1
  35. package/dist/ValidationBuilder.cjs +0 -80
  36. package/dist/ValidationBuilder.cjs.map +0 -1
  37. package/dist/ValidationBuilder.d.cts +0 -319
  38. package/dist/ValidationBuilder.d.cts.map +0 -1
  39. package/dist/ValidationBuilder.d.ts +0 -319
  40. package/dist/ValidationBuilder.d.ts.map +0 -1
  41. package/dist/ValidationBuilder.js +0 -69
  42. package/dist/ValidationBuilder.js.map +0 -1
  43. package/dist/core.d.cts +0 -1393
  44. package/dist/core.d.cts.map +0 -1
  45. package/dist/core.d.ts +0 -1393
  46. package/dist/core.d.ts.map +0 -1
  47. package/dist/index.cjs.map +0 -1
  48. package/dist/index.d.cts.map +0 -1
  49. package/dist/index.d.ts.map +0 -1
  50. package/dist/index.js.map +0 -1
  51. package/dist/plugin/index.d.cts.map +0 -1
  52. package/dist/plugin/index.d.ts.map +0 -1
@@ -0,0 +1,46 @@
1
+ import {
2
+ ArgumentError
3
+ } from "./chunk-5R4AALC7.js";
4
+
5
+ // src/core/errors/argument/ValidationError.ts
6
+ var ValidationError = class extends ArgumentError {
7
+ constructor(errors) {
8
+ super(
9
+ `${errors.length} validation error(s):
10
+ ${errors.map((e, i) => ` ${i + 1}. ${e}`).join("\n")}`
11
+ );
12
+ this.errors = errors;
13
+ }
14
+ };
15
+
16
+ // src/utility/ValidationBuilder.ts
17
+ var ValidationBuilder = class {
18
+ constructor() {
19
+ this.errors = [];
20
+ }
21
+ /**
22
+ * Runs `fn` and collects any thrown error message. Returns `this` for chaining.
23
+ */
24
+ check(fn) {
25
+ try {
26
+ fn();
27
+ } catch (e) {
28
+ this.errors.push(e instanceof Error ? e.message : String(e));
29
+ }
30
+ return this;
31
+ }
32
+ /**
33
+ * Throws a `ValidationError` with all collected messages if any `check` calls failed.
34
+ * Does nothing when no errors were collected.
35
+ */
36
+ throwIfAny() {
37
+ if (this.errors.length > 0) {
38
+ throw new ValidationError(this.errors);
39
+ }
40
+ }
41
+ };
42
+
43
+ export {
44
+ ValidationError,
45
+ ValidationBuilder
46
+ };