xdbc 1.0.217 → 1.0.219

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 (120) hide show
  1. package/.gitattributes +16 -8
  2. package/.vscode/settings.json +3 -3
  3. package/.vscode/tasks.json +23 -23
  4. package/ASSESSMENT.md +249 -0
  5. package/README.md +538 -408
  6. package/__tests__/DBC/AE.test.ts +62 -62
  7. package/__tests__/DBC/ARRAY.test.ts +91 -91
  8. package/__tests__/DBC/DEFINED.test.ts +53 -53
  9. package/__tests__/DBC/DOM.test.ts +786 -0
  10. package/__tests__/DBC/Decorators.test.ts +367 -367
  11. package/__tests__/DBC/EQ.test.ts +13 -13
  12. package/__tests__/DBC/GREATER.test.ts +31 -31
  13. package/__tests__/DBC/HasAttribute.test.ts +60 -60
  14. package/__tests__/DBC/IF.test.ts +62 -62
  15. package/__tests__/DBC/INSTANCE.test.ts +13 -13
  16. package/__tests__/DBC/JSON.OP.test.ts +47 -47
  17. package/__tests__/DBC/JSON.Parse.test.ts +17 -17
  18. package/__tests__/DBC/OR.test.ts +14 -14
  19. package/__tests__/DBC/PLAIN_OBJECT.test.ts +109 -109
  20. package/__tests__/DBC/REGEX.test.ts +17 -17
  21. package/__tests__/DBC/TYPE.test.ts +13 -13
  22. package/__tests__/DBC/UNDEFINED.test.ts +45 -45
  23. package/__tests__/DBC/ZOD.test.ts +54 -54
  24. package/__tests__/DBC/onInfringement.test.ts +262 -0
  25. package/biome.json +45 -40
  26. package/dist/DBC/AE.js +172 -0
  27. package/dist/DBC/ARR/PLAIN_OBJECT.d.ts +0 -3
  28. package/dist/DBC/ARR/PLAIN_OBJECT.js +95 -0
  29. package/dist/DBC/ARRAY.d.ts +0 -3
  30. package/dist/DBC/ARRAY.js +90 -0
  31. package/dist/DBC/COMPARISON/GREATER.js +21 -0
  32. package/dist/DBC/COMPARISON/GREATER_OR_EQUAL.js +21 -0
  33. package/dist/DBC/COMPARISON/LESS.js +21 -0
  34. package/dist/DBC/COMPARISON/LESS_OR_EQUAL.js +21 -0
  35. package/dist/DBC/COMPARISON.js +98 -0
  36. package/dist/DBC/DEFINED.js +87 -0
  37. package/dist/DBC/DOM.d.ts +123 -0
  38. package/dist/DBC/DOM.js +362 -0
  39. package/dist/DBC/EQ/DIFFERENT.js +34 -0
  40. package/dist/DBC/EQ.js +101 -0
  41. package/dist/DBC/GREATER.js +99 -0
  42. package/dist/DBC/HasAttribute.js +101 -0
  43. package/dist/DBC/IF.js +96 -0
  44. package/dist/DBC/INSTANCE.js +122 -0
  45. package/dist/DBC/JSON.OP.js +120 -0
  46. package/dist/DBC/JSON.Parse.js +104 -0
  47. package/dist/DBC/OR.js +125 -0
  48. package/dist/DBC/REGEX.js +136 -0
  49. package/dist/DBC/TYPE.js +112 -0
  50. package/dist/DBC/UNDEFINED.js +87 -0
  51. package/dist/DBC/ZOD.js +99 -0
  52. package/dist/DBC.d.ts +18 -4
  53. package/dist/DBC.js +645 -0
  54. package/dist/Demo.d.ts +10 -0
  55. package/dist/Demo.js +713 -0
  56. package/dist/Test.html +18 -0
  57. package/dist/bundle.js +6140 -405
  58. package/dist/index.d.ts +22 -0
  59. package/dist/index.html +18 -0
  60. package/dist/index.js +22 -0
  61. package/docs/assets/highlight.css +22 -22
  62. package/docs/assets/icons.js +17 -17
  63. package/docs/assets/main.js +60 -60
  64. package/docs/assets/style.css +1640 -1640
  65. package/docs/classes/DBC.DBC.html +98 -98
  66. package/docs/classes/DBC_AE.AE.html +160 -160
  67. package/docs/classes/DBC_EQ.EQ.html +131 -131
  68. package/docs/classes/DBC_GREATER.GREATER.html +139 -139
  69. package/docs/classes/DBC_INSTANCE.INSTANCE.html +130 -130
  70. package/docs/classes/DBC_JSON.OP.JSON_OP.html +138 -138
  71. package/docs/classes/DBC_JSON.Parse.JSON_Parse.html +129 -129
  72. package/docs/classes/DBC_OR.OR.html +137 -137
  73. package/docs/classes/DBC_REGEX.REGEX.html +136 -136
  74. package/docs/classes/DBC_TYPE.TYPE.html +130 -130
  75. package/docs/classes/Demo.Demo.html +14 -14
  76. package/docs/hierarchy.html +1 -1
  77. package/docs/index.html +1 -1
  78. package/docs/modules/DBC.html +1 -1
  79. package/docs/modules/DBC_AE.html +1 -1
  80. package/docs/modules/DBC_EQ.html +1 -1
  81. package/docs/modules/DBC_GREATER.html +1 -1
  82. package/docs/modules/DBC_INSTANCE.html +1 -1
  83. package/docs/modules/DBC_JSON.OP.html +1 -1
  84. package/docs/modules/DBC_JSON.Parse.html +1 -1
  85. package/docs/modules/DBC_OR.html +1 -1
  86. package/docs/modules/DBC_REGEX.html +1 -1
  87. package/docs/modules/DBC_TYPE.html +1 -1
  88. package/docs/modules/Demo.html +1 -1
  89. package/jest.config.js +32 -32
  90. package/package.json +71 -55
  91. package/src/DBC/AE.ts +269 -288
  92. package/src/DBC/ARR/PLAIN_OBJECT.ts +122 -133
  93. package/src/DBC/ARRAY.ts +117 -127
  94. package/src/DBC/COMPARISON/GREATER.ts +41 -46
  95. package/src/DBC/COMPARISON/GREATER_OR_EQUAL.ts +41 -45
  96. package/src/DBC/COMPARISON/LESS.ts +41 -45
  97. package/src/DBC/COMPARISON/LESS_OR_EQUAL.ts +41 -45
  98. package/src/DBC/COMPARISON.ts +149 -159
  99. package/src/DBC/DEFINED.ts +117 -122
  100. package/src/DBC/DOM.ts +453 -0
  101. package/src/DBC/EQ/DIFFERENT.ts +51 -57
  102. package/src/DBC/EQ.ts +154 -163
  103. package/src/DBC/HasAttribute.ts +149 -154
  104. package/src/DBC/IF.ts +173 -179
  105. package/src/DBC/INSTANCE.ts +168 -171
  106. package/src/DBC/JSON.OP.ts +178 -186
  107. package/src/DBC/JSON.Parse.ts +150 -157
  108. package/src/DBC/OR.ts +183 -187
  109. package/src/DBC/REGEX.ts +195 -196
  110. package/src/DBC/TYPE.ts +142 -149
  111. package/src/DBC/UNDEFINED.ts +115 -117
  112. package/src/DBC/ZOD.ts +130 -135
  113. package/src/DBC.ts +902 -904
  114. package/src/Demo.ts +537 -404
  115. package/src/index.ts +22 -0
  116. package/tsconfig.json +18 -18
  117. package/tsconfig.test.json +7 -7
  118. package/typedoc.json +16 -16
  119. package/webpack.config.js +27 -27
  120. package/Assessment.md +0 -507
@@ -1,109 +1,109 @@
1
- import { PLAIN_OBJECT } from "../../src/DBC/ARR/PLAIN_OBJECT";
2
- import { DBC } from "../../src/DBC";
3
-
4
- describe("PLAIN_OBJECT", () => {
5
- const plainObject = new PLAIN_OBJECT();
6
-
7
- test("Should not report infringement with a plain object", () => {
8
- expect(plainObject.check({ a: 1 })).toBe(true);
9
- });
10
-
11
- test("Should not report infringement with an empty object", () => {
12
- expect(plainObject.check({})).toBe(true);
13
- });
14
-
15
- test("Should not report infringement with undefined (null-passthrough)", () => {
16
- expect(plainObject.check(undefined)).toBe(true);
17
- });
18
-
19
- test("Should not report infringement with null (null-passthrough)", () => {
20
- expect(plainObject.check(null)).toBe(true);
21
- });
22
-
23
- test("Should report infringement with an array", () => {
24
- expect(typeof plainObject.check([])).toBe("string");
25
- });
26
-
27
- test("Should report infringement with a non-empty array", () => {
28
- expect(typeof plainObject.check([1, 2, 3])).toBe("string");
29
- });
30
-
31
- test("Should report infringement with a string", () => {
32
- expect(typeof plainObject.check("hello")).toBe("string");
33
- });
34
-
35
- test("Should report infringement with a number", () => {
36
- expect(typeof plainObject.check(42)).toBe("string");
37
- });
38
-
39
- describe("checkAlgorithm", () => {
40
- test("Should return true for a plain object", () => {
41
- expect(PLAIN_OBJECT.checkAlgorithm({ key: "value" })).toBe(true);
42
- });
43
-
44
- test("Should return true for an empty object", () => {
45
- expect(PLAIN_OBJECT.checkAlgorithm({})).toBe(true);
46
- });
47
-
48
- test("Should return true for null (null-passthrough)", () => {
49
- expect(PLAIN_OBJECT.checkAlgorithm(null)).toBe(true);
50
- });
51
-
52
- test("Should return true for undefined (null-passthrough)", () => {
53
- expect(PLAIN_OBJECT.checkAlgorithm(undefined)).toBe(true);
54
- });
55
-
56
- test("Should return string for an array", () => {
57
- const result = PLAIN_OBJECT.checkAlgorithm([]);
58
- expect(typeof result).toBe("string");
59
- expect(result).toContain("ARRAY");
60
- });
61
-
62
- test("Should return string for a non-empty array", () => {
63
- const result = PLAIN_OBJECT.checkAlgorithm([1, 2, 3]);
64
- expect(typeof result).toBe("string");
65
- expect(result).toContain("ARRAY");
66
- });
67
-
68
- test("Should return string for a string value", () => {
69
- const result = PLAIN_OBJECT.checkAlgorithm("hello");
70
- expect(typeof result).toBe("string");
71
- expect(result).toContain("PLAIN_OBJECT");
72
- });
73
-
74
- test("Should return string for a number", () => {
75
- const result = PLAIN_OBJECT.checkAlgorithm(42);
76
- expect(typeof result).toBe("string");
77
- expect(result).toContain("PLAIN_OBJECT");
78
- });
79
- });
80
-
81
- describe("tsCheck", () => {
82
- test("Should return the value when it is a plain object", () => {
83
- const value = { x: 1 };
84
- expect(PLAIN_OBJECT.tsCheck(value)).toBe(value);
85
- });
86
-
87
- test("Should throw DBC.Infringement when value is an array", () => {
88
- expect(() => PLAIN_OBJECT.tsCheck([] as any)).toThrow(DBC.Infringement);
89
- });
90
-
91
- test("Should throw DBC.Infringement when value is a string", () => {
92
- expect(() => PLAIN_OBJECT.tsCheck("oops" as any)).toThrow(
93
- DBC.Infringement,
94
- );
95
- });
96
-
97
- test("Should include hint in the infringement message", () => {
98
- expect(() =>
99
- PLAIN_OBJECT.tsCheck([] as any, "must be a plain object"),
100
- ).toThrow(/must be a plain object/);
101
- });
102
-
103
- test("Should include id in the infringement message", () => {
104
- expect(() =>
105
- PLAIN_OBJECT.tsCheck(42 as any, undefined, "optionsParam"),
106
- ).toThrow(/optionsParam/);
107
- });
108
- });
109
- });
1
+ import { DBC } from "../../src/DBC";
2
+ import { PLAIN_OBJECT } from "../../src/DBC/ARR/PLAIN_OBJECT";
3
+
4
+ describe("PLAIN_OBJECT", () => {
5
+ const plainObject = new PLAIN_OBJECT();
6
+
7
+ test("Should not report infringement with a plain object", () => {
8
+ expect(plainObject.check({ a: 1 })).toBe(true);
9
+ });
10
+
11
+ test("Should not report infringement with an empty object", () => {
12
+ expect(plainObject.check({})).toBe(true);
13
+ });
14
+
15
+ test("Should not report infringement with undefined (null-passthrough)", () => {
16
+ expect(plainObject.check(undefined)).toBe(true);
17
+ });
18
+
19
+ test("Should not report infringement with null (null-passthrough)", () => {
20
+ expect(plainObject.check(null)).toBe(true);
21
+ });
22
+
23
+ test("Should report infringement with an array", () => {
24
+ expect(typeof plainObject.check([])).toBe("string");
25
+ });
26
+
27
+ test("Should report infringement with a non-empty array", () => {
28
+ expect(typeof plainObject.check([1, 2, 3])).toBe("string");
29
+ });
30
+
31
+ test("Should report infringement with a string", () => {
32
+ expect(typeof plainObject.check("hello")).toBe("string");
33
+ });
34
+
35
+ test("Should report infringement with a number", () => {
36
+ expect(typeof plainObject.check(42)).toBe("string");
37
+ });
38
+
39
+ describe("checkAlgorithm", () => {
40
+ test("Should return true for a plain object", () => {
41
+ expect(PLAIN_OBJECT.checkAlgorithm({ key: "value" })).toBe(true);
42
+ });
43
+
44
+ test("Should return true for an empty object", () => {
45
+ expect(PLAIN_OBJECT.checkAlgorithm({})).toBe(true);
46
+ });
47
+
48
+ test("Should return true for null (null-passthrough)", () => {
49
+ expect(PLAIN_OBJECT.checkAlgorithm(null)).toBe(true);
50
+ });
51
+
52
+ test("Should return true for undefined (null-passthrough)", () => {
53
+ expect(PLAIN_OBJECT.checkAlgorithm(undefined)).toBe(true);
54
+ });
55
+
56
+ test("Should return string for an array", () => {
57
+ const result = PLAIN_OBJECT.checkAlgorithm([]);
58
+ expect(typeof result).toBe("string");
59
+ expect(result).toContain("ARRAY");
60
+ });
61
+
62
+ test("Should return string for a non-empty array", () => {
63
+ const result = PLAIN_OBJECT.checkAlgorithm([1, 2, 3]);
64
+ expect(typeof result).toBe("string");
65
+ expect(result).toContain("ARRAY");
66
+ });
67
+
68
+ test("Should return string for a string value", () => {
69
+ const result = PLAIN_OBJECT.checkAlgorithm("hello");
70
+ expect(typeof result).toBe("string");
71
+ expect(result).toContain("PLAIN_OBJECT");
72
+ });
73
+
74
+ test("Should return string for a number", () => {
75
+ const result = PLAIN_OBJECT.checkAlgorithm(42);
76
+ expect(typeof result).toBe("string");
77
+ expect(result).toContain("PLAIN_OBJECT");
78
+ });
79
+ });
80
+
81
+ describe("tsCheck", () => {
82
+ test("Should return the value when it is a plain object", () => {
83
+ const value = { x: 1 };
84
+ expect(PLAIN_OBJECT.tsCheck(value)).toBe(value);
85
+ });
86
+
87
+ test("Should throw DBC.Infringement when value is an array", () => {
88
+ expect(() => PLAIN_OBJECT.tsCheck([] as any)).toThrow(DBC.Infringement);
89
+ });
90
+
91
+ test("Should throw DBC.Infringement when value is a string", () => {
92
+ expect(() => PLAIN_OBJECT.tsCheck("oops" as any)).toThrow(
93
+ DBC.Infringement,
94
+ );
95
+ });
96
+
97
+ test("Should include hint in the infringement message", () => {
98
+ expect(() =>
99
+ PLAIN_OBJECT.tsCheck([] as any, "must be a plain object"),
100
+ ).toThrow(/must be a plain object/);
101
+ });
102
+
103
+ test("Should include id in the infringement message", () => {
104
+ expect(() =>
105
+ PLAIN_OBJECT.tsCheck(42 as any, undefined, "optionsParam"),
106
+ ).toThrow(/optionsParam/);
107
+ });
108
+ });
109
+ });
@@ -1,17 +1,17 @@
1
- import { REGEX } from "../../src/DBC/REGEX";
2
-
3
- describe("REGEX", () => {
4
- const regex = new REGEX(/^a$/);
5
-
6
- test("Should not report infringement with 'a' to check", () => {
7
- expect(regex.check("a")).toBe(true);
8
- });
9
-
10
- test("Should report infringement with 'c' to check", () => {
11
- expect(typeof regex.check("c")).toBe("string");
12
- });
13
-
14
- test("Should not report infringement with empty string", () => {
15
- expect(regex.check("")).toBe(true);
16
- });
17
- });
1
+ import { REGEX } from "../../src/DBC/REGEX";
2
+
3
+ describe("REGEX", () => {
4
+ const regex = new REGEX(/^a$/);
5
+
6
+ test("Should not report infringement with 'a' to check", () => {
7
+ expect(regex.check("a")).toBe(true);
8
+ });
9
+
10
+ test("Should report infringement with 'c' to check", () => {
11
+ expect(typeof regex.check("c")).toBe("string");
12
+ });
13
+
14
+ test("Should not report infringement with empty string", () => {
15
+ expect(regex.check("")).toBe(true);
16
+ });
17
+ });
@@ -1,13 +1,13 @@
1
- import { TYPE } from "../../src/DBC/TYPE";
2
-
3
- describe("TYPE", () => {
4
- const type = new TYPE("string");
5
-
6
- test("Should not report infringement with 'a' to check", () => {
7
- expect(type.check("a")).toBe(true);
8
- });
9
-
10
- test("Should report infringement with 1 to check", () => {
11
- expect(typeof type.check(1)).toBe("string");
12
- });
13
- });
1
+ import { TYPE } from "../../src/DBC/TYPE";
2
+
3
+ describe("TYPE", () => {
4
+ const type = new TYPE("string");
5
+
6
+ test("Should not report infringement with 'a' to check", () => {
7
+ expect(type.check("a")).toBe(true);
8
+ });
9
+
10
+ test("Should report infringement with 1 to check", () => {
11
+ expect(typeof type.check(1)).toBe("string");
12
+ });
13
+ });
@@ -1,45 +1,45 @@
1
- import { UNDEFINED } from "../../src/DBC/UNDEFINED";
2
-
3
- describe("UNDEFINED", () => {
4
- const undef = new UNDEFINED();
5
-
6
- test("Should not report infringement with undefined", () => {
7
- expect(undef.check(undefined)).toBe(true);
8
- });
9
-
10
- test("Should report infringement with null", () => {
11
- expect(typeof undef.check(null)).toBe("string");
12
- });
13
-
14
- test("Should report infringement with a string value", () => {
15
- expect(typeof undef.check("hello")).toBe("string");
16
- });
17
-
18
- test("Should report infringement with a number value", () => {
19
- expect(typeof undef.check(42)).toBe("string");
20
- });
21
-
22
- test("Should report infringement with zero", () => {
23
- expect(typeof undef.check(0)).toBe("string");
24
- });
25
-
26
- test("Should report infringement with false", () => {
27
- expect(typeof undef.check(false)).toBe("string");
28
- });
29
-
30
- test("Should report infringement with an empty string", () => {
31
- expect(typeof undef.check("")).toBe("string");
32
- });
33
-
34
- describe("checkAlgorithm", () => {
35
- test("Should return true for undefined", () => {
36
- expect(UNDEFINED.checkAlgorithm(undefined)).toBe(true);
37
- });
38
-
39
- test("Should return string for defined values", () => {
40
- expect(typeof UNDEFINED.checkAlgorithm("test")).toBe("string");
41
- expect(typeof UNDEFINED.checkAlgorithm(0)).toBe("string");
42
- expect(typeof UNDEFINED.checkAlgorithm(null)).toBe("string");
43
- });
44
- });
45
- });
1
+ import { UNDEFINED } from "../../src/DBC/UNDEFINED";
2
+
3
+ describe("UNDEFINED", () => {
4
+ const undef = new UNDEFINED();
5
+
6
+ test("Should not report infringement with undefined", () => {
7
+ expect(undef.check(undefined)).toBe(true);
8
+ });
9
+
10
+ test("Should report infringement with null", () => {
11
+ expect(typeof undef.check(null)).toBe("string");
12
+ });
13
+
14
+ test("Should report infringement with a string value", () => {
15
+ expect(typeof undef.check("hello")).toBe("string");
16
+ });
17
+
18
+ test("Should report infringement with a number value", () => {
19
+ expect(typeof undef.check(42)).toBe("string");
20
+ });
21
+
22
+ test("Should report infringement with zero", () => {
23
+ expect(typeof undef.check(0)).toBe("string");
24
+ });
25
+
26
+ test("Should report infringement with false", () => {
27
+ expect(typeof undef.check(false)).toBe("string");
28
+ });
29
+
30
+ test("Should report infringement with an empty string", () => {
31
+ expect(typeof undef.check("")).toBe("string");
32
+ });
33
+
34
+ describe("checkAlgorithm", () => {
35
+ test("Should return true for undefined", () => {
36
+ expect(UNDEFINED.checkAlgorithm(undefined)).toBe(true);
37
+ });
38
+
39
+ test("Should return string for defined values", () => {
40
+ expect(typeof UNDEFINED.checkAlgorithm("test")).toBe("string");
41
+ expect(typeof UNDEFINED.checkAlgorithm(0)).toBe("string");
42
+ expect(typeof UNDEFINED.checkAlgorithm(null)).toBe("string");
43
+ });
44
+ });
45
+ });
@@ -1,54 +1,54 @@
1
- import { z } from "zod";
2
- import { ZOD } from "../../src/DBC/ZOD";
3
-
4
- describe("ZOD", () => {
5
- describe("string schema", () => {
6
- const zodString = new ZOD(z.string());
7
-
8
- test("Should not report infringement with a string value", () => {
9
- expect(zodString.check("hello")).toBe(true);
10
- });
11
-
12
- test("Should report infringement with a number value", () => {
13
- expect(typeof zodString.check(42)).toBe("string");
14
- });
15
- });
16
-
17
- describe("number schema", () => {
18
- const zodNumber = new ZOD(z.number());
19
-
20
- test("Should not report infringement with a number value", () => {
21
- expect(zodNumber.check(42)).toBe(true);
22
- });
23
-
24
- test("Should report infringement with a string value", () => {
25
- expect(typeof zodNumber.check("hello")).toBe("string");
26
- });
27
- });
28
-
29
- describe("object schema", () => {
30
- const zodObject = new ZOD(z.object({ name: z.string(), age: z.number() }));
31
-
32
- test("Should not report infringement with a valid object", () => {
33
- expect(zodObject.check({ name: "Alice", age: 30 })).toBe(true);
34
- });
35
-
36
- test("Should report infringement with an invalid object", () => {
37
- expect(typeof zodObject.check({ name: 123 })).toBe("string");
38
- });
39
-
40
- test("Should report infringement with a non-object value", () => {
41
- expect(typeof zodObject.check("not an object")).toBe("string");
42
- });
43
- });
44
-
45
- describe("checkAlgorithm", () => {
46
- test("Should return true for valid value", () => {
47
- expect(ZOD.checkAlgorithm("test", z.string())).toBe(true);
48
- });
49
-
50
- test("Should return string for invalid value", () => {
51
- expect(typeof ZOD.checkAlgorithm(42, z.string())).toBe("string");
52
- });
53
- });
54
- });
1
+ import { z } from "zod";
2
+ import { ZOD } from "../../src/DBC/ZOD";
3
+
4
+ describe("ZOD", () => {
5
+ describe("string schema", () => {
6
+ const zodString = new ZOD(z.string());
7
+
8
+ test("Should not report infringement with a string value", () => {
9
+ expect(zodString.check("hello")).toBe(true);
10
+ });
11
+
12
+ test("Should report infringement with a number value", () => {
13
+ expect(typeof zodString.check(42)).toBe("string");
14
+ });
15
+ });
16
+
17
+ describe("number schema", () => {
18
+ const zodNumber = new ZOD(z.number());
19
+
20
+ test("Should not report infringement with a number value", () => {
21
+ expect(zodNumber.check(42)).toBe(true);
22
+ });
23
+
24
+ test("Should report infringement with a string value", () => {
25
+ expect(typeof zodNumber.check("hello")).toBe("string");
26
+ });
27
+ });
28
+
29
+ describe("object schema", () => {
30
+ const zodObject = new ZOD(z.object({ name: z.string(), age: z.number() }));
31
+
32
+ test("Should not report infringement with a valid object", () => {
33
+ expect(zodObject.check({ name: "Alice", age: 30 })).toBe(true);
34
+ });
35
+
36
+ test("Should report infringement with an invalid object", () => {
37
+ expect(typeof zodObject.check({ name: 123 })).toBe("string");
38
+ });
39
+
40
+ test("Should report infringement with a non-object value", () => {
41
+ expect(typeof zodObject.check("not an object")).toBe("string");
42
+ });
43
+ });
44
+
45
+ describe("checkAlgorithm", () => {
46
+ test("Should return true for valid value", () => {
47
+ expect(ZOD.checkAlgorithm("test", z.string())).toBe(true);
48
+ });
49
+
50
+ test("Should return string for invalid value", () => {
51
+ expect(typeof ZOD.checkAlgorithm(42, z.string())).toBe("string");
52
+ });
53
+ });
54
+ });