xdbc 1.0.217 → 1.0.218

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 (89) hide show
  1. package/.gitattributes +8 -0
  2. package/.vscode/settings.json +3 -3
  3. package/.vscode/tasks.json +23 -23
  4. package/ASSESSMENT.md +249 -0
  5. package/README.md +131 -1
  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 +481 -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 +40 -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 +87 -0
  38. package/dist/DBC/DOM.js +223 -0
  39. package/dist/DBC/EQ/DIFFERENT.js +34 -0
  40. package/dist/DBC/EQ.js +101 -0
  41. package/dist/DBC/HasAttribute.js +101 -0
  42. package/dist/DBC/IF.js +96 -0
  43. package/dist/DBC/INSTANCE.js +122 -0
  44. package/dist/DBC/JSON.OP.js +120 -0
  45. package/dist/DBC/JSON.Parse.js +104 -0
  46. package/dist/DBC/OR.js +125 -0
  47. package/dist/DBC/REGEX.js +136 -0
  48. package/dist/DBC/TYPE.js +112 -0
  49. package/dist/DBC/UNDEFINED.js +87 -0
  50. package/dist/DBC/ZOD.js +99 -0
  51. package/dist/DBC.d.ts +18 -4
  52. package/dist/DBC.js +645 -0
  53. package/dist/Demo.d.ts +10 -0
  54. package/dist/Demo.js +713 -0
  55. package/dist/bundle.js +6140 -405
  56. package/dist/index.d.ts +22 -0
  57. package/dist/index.js +22 -0
  58. package/jest.config.js +32 -32
  59. package/package.json +71 -55
  60. package/src/DBC/AE.ts +269 -288
  61. package/src/DBC/ARR/PLAIN_OBJECT.ts +122 -133
  62. package/src/DBC/ARRAY.ts +117 -127
  63. package/src/DBC/COMPARISON/GREATER.ts +41 -46
  64. package/src/DBC/COMPARISON/GREATER_OR_EQUAL.ts +41 -45
  65. package/src/DBC/COMPARISON/LESS.ts +41 -45
  66. package/src/DBC/COMPARISON/LESS_OR_EQUAL.ts +41 -45
  67. package/src/DBC/COMPARISON.ts +149 -159
  68. package/src/DBC/DEFINED.ts +117 -122
  69. package/src/DBC/DOM.ts +291 -0
  70. package/src/DBC/EQ/DIFFERENT.ts +51 -57
  71. package/src/DBC/EQ.ts +154 -163
  72. package/src/DBC/HasAttribute.ts +149 -154
  73. package/src/DBC/IF.ts +173 -179
  74. package/src/DBC/INSTANCE.ts +168 -171
  75. package/src/DBC/JSON.OP.ts +178 -186
  76. package/src/DBC/JSON.Parse.ts +150 -157
  77. package/src/DBC/OR.ts +183 -187
  78. package/src/DBC/REGEX.ts +195 -196
  79. package/src/DBC/TYPE.ts +142 -149
  80. package/src/DBC/UNDEFINED.ts +115 -117
  81. package/src/DBC/ZOD.ts +130 -135
  82. package/src/DBC.ts +902 -904
  83. package/src/Demo.ts +537 -404
  84. package/src/index.ts +22 -0
  85. package/tsconfig.json +18 -18
  86. package/tsconfig.test.json +7 -7
  87. package/typedoc.json +16 -16
  88. package/webpack.config.js +27 -27
  89. package/Assessment.md +0 -507
@@ -1,13 +1,13 @@
1
- import { EQ } from "../../src/DBC/EQ";
2
-
3
- describe("EQ", () => {
4
- const eq = new EQ("b");
5
-
6
- test("Should not report infringement with 'b' to check", () => {
7
- expect(eq.check("b")).toBe(true);
8
- });
9
-
10
- test("Should report infringement with 'c' to check", () => {
11
- expect(typeof eq.check("c")).toBe("string");
12
- });
13
- });
1
+ import { EQ } from "../../src/DBC/EQ";
2
+
3
+ describe("EQ", () => {
4
+ const eq = new EQ("b");
5
+
6
+ test("Should not report infringement with 'b' to check", () => {
7
+ expect(eq.check("b")).toBe(true);
8
+ });
9
+
10
+ test("Should report infringement with 'c' to check", () => {
11
+ expect(typeof eq.check("c")).toBe("string");
12
+ });
13
+ });
@@ -1,31 +1,31 @@
1
- import { GREATER } from "../../src/DBC/COMPARISON/GREATER";
2
- import { GREATER_OR_EQUAL } from "../../src/DBC/COMPARISON/GREATER_OR_EQUAL";
3
- import { LESS_OR_EQUAL } from "../../src/DBC/COMPARISON/LESS_OR_EQUAL";
4
-
5
- describe("GREATER", () => {
6
- const greater = new GREATER(1);
7
-
8
- test("Should not report infringement with '2' to check", () => {
9
- expect(greater.check(2)).toBe(true);
10
- });
11
-
12
- test("Should report infringement with '0' to check", () => {
13
- expect(typeof greater.check(0)).toBe("string");
14
- });
15
-
16
- test("Should report infringement with '1' to check (equality not permitted)", () => {
17
- expect(typeof greater.check(1)).toBe("string");
18
- });
19
-
20
- test("Should not report infringement with '1' and '1' to check since equality is now permitted", () => {
21
- expect(new GREATER_OR_EQUAL(1).check(1)).toBe(true);
22
- });
23
-
24
- test("Should not report infringement with '1' and '1' to check since inverting the result is now on", () => {
25
- expect(new LESS_OR_EQUAL(1).check(1)).toBe(true);
26
- });
27
-
28
- test("Should not report infringement with 'undefined' and 'undefined' to check", () => {
29
- expect(new GREATER(undefined).check(undefined)).toBe(true);
30
- });
31
- });
1
+ import { GREATER } from "../../src/DBC/COMPARISON/GREATER";
2
+ import { GREATER_OR_EQUAL } from "../../src/DBC/COMPARISON/GREATER_OR_EQUAL";
3
+ import { LESS_OR_EQUAL } from "../../src/DBC/COMPARISON/LESS_OR_EQUAL";
4
+
5
+ describe("GREATER", () => {
6
+ const greater = new GREATER(1);
7
+
8
+ test("Should not report infringement with '2' to check", () => {
9
+ expect(greater.check(2)).toBe(true);
10
+ });
11
+
12
+ test("Should report infringement with '0' to check", () => {
13
+ expect(typeof greater.check(0)).toBe("string");
14
+ });
15
+
16
+ test("Should report infringement with '1' to check (equality not permitted)", () => {
17
+ expect(typeof greater.check(1)).toBe("string");
18
+ });
19
+
20
+ test("Should not report infringement with '1' and '1' to check since equality is now permitted", () => {
21
+ expect(new GREATER_OR_EQUAL(1).check(1)).toBe(true);
22
+ });
23
+
24
+ test("Should not report infringement with '1' and '1' to check since inverting the result is now on", () => {
25
+ expect(new LESS_OR_EQUAL(1).check(1)).toBe(true);
26
+ });
27
+
28
+ test("Should not report infringement with 'undefined' and 'undefined' to check", () => {
29
+ expect(new GREATER(undefined).check(undefined)).toBe(true);
30
+ });
31
+ });
@@ -1,60 +1,60 @@
1
- import { HasAttribute } from "../../src/DBC/HasAttribute";
2
-
3
- describe("HasAttribute", () => {
4
- const hasId = new HasAttribute("id");
5
-
6
- test("Should not report infringement when attribute exists", () => {
7
- const el = document.createElement("div");
8
- el.setAttribute("id", "test");
9
- expect(hasId.check(el)).toBe(true);
10
- });
11
-
12
- test("Should report infringement when attribute is missing", () => {
13
- const el = document.createElement("div");
14
- expect(typeof hasId.check(el)).toBe("string");
15
- });
16
-
17
- test("Should report infringement when value is not an HTMLElement", () => {
18
- expect(typeof hasId.check("not an element")).toBe("string");
19
- });
20
-
21
- test("Should report infringement when value is a plain object", () => {
22
- expect(typeof hasId.check({ id: "test" })).toBe("string");
23
- });
24
-
25
- describe("invert", () => {
26
- const noId = new HasAttribute("id", true);
27
-
28
- test("Should not report infringement when attribute is absent", () => {
29
- const el = document.createElement("div");
30
- expect(noId.check(el)).toBe(true);
31
- });
32
-
33
- test("Should report infringement when forbidden attribute exists", () => {
34
- const el = document.createElement("div");
35
- el.setAttribute("id", "test");
36
- expect(typeof noId.check(el)).toBe("string");
37
- });
38
- });
39
-
40
- describe("checkAlgorithm", () => {
41
- test("Should return true when element has the attribute", () => {
42
- const el = document.createElement("span");
43
- el.setAttribute("class", "active");
44
- expect(HasAttribute.checkAlgorithm(el, "class", false)).toBe(true);
45
- });
46
-
47
- test("Should return string when element lacks the attribute", () => {
48
- const el = document.createElement("span");
49
- expect(typeof HasAttribute.checkAlgorithm(el, "class", false)).toBe(
50
- "string",
51
- );
52
- });
53
-
54
- test("Should return string for non-HTMLElement", () => {
55
- expect(typeof HasAttribute.checkAlgorithm(42, "id", false)).toBe(
56
- "string",
57
- );
58
- });
59
- });
60
- });
1
+ import { HasAttribute } from "../../src/DBC/HasAttribute";
2
+
3
+ describe("HasAttribute", () => {
4
+ const hasId = new HasAttribute("id");
5
+
6
+ test("Should not report infringement when attribute exists", () => {
7
+ const el = document.createElement("div");
8
+ el.setAttribute("id", "test");
9
+ expect(hasId.check(el)).toBe(true);
10
+ });
11
+
12
+ test("Should report infringement when attribute is missing", () => {
13
+ const el = document.createElement("div");
14
+ expect(typeof hasId.check(el)).toBe("string");
15
+ });
16
+
17
+ test("Should report infringement when value is not an HTMLElement", () => {
18
+ expect(typeof hasId.check("not an element")).toBe("string");
19
+ });
20
+
21
+ test("Should report infringement when value is a plain object", () => {
22
+ expect(typeof hasId.check({ id: "test" })).toBe("string");
23
+ });
24
+
25
+ describe("invert", () => {
26
+ const noId = new HasAttribute("id", true);
27
+
28
+ test("Should not report infringement when attribute is absent", () => {
29
+ const el = document.createElement("div");
30
+ expect(noId.check(el)).toBe(true);
31
+ });
32
+
33
+ test("Should report infringement when forbidden attribute exists", () => {
34
+ const el = document.createElement("div");
35
+ el.setAttribute("id", "test");
36
+ expect(typeof noId.check(el)).toBe("string");
37
+ });
38
+ });
39
+
40
+ describe("checkAlgorithm", () => {
41
+ test("Should return true when element has the attribute", () => {
42
+ const el = document.createElement("span");
43
+ el.setAttribute("class", "active");
44
+ expect(HasAttribute.checkAlgorithm(el, "class", false)).toBe(true);
45
+ });
46
+
47
+ test("Should return string when element lacks the attribute", () => {
48
+ const el = document.createElement("span");
49
+ expect(typeof HasAttribute.checkAlgorithm(el, "class", false)).toBe(
50
+ "string",
51
+ );
52
+ });
53
+
54
+ test("Should return string for non-HTMLElement", () => {
55
+ expect(typeof HasAttribute.checkAlgorithm(42, "id", false)).toBe(
56
+ "string",
57
+ );
58
+ });
59
+ });
60
+ });
@@ -1,62 +1,62 @@
1
- import { EQ } from "../../src/DBC/EQ";
2
- import { IF } from "../../src/DBC/IF";
3
- import { TYPE } from "../../src/DBC/TYPE";
4
-
5
- describe("IF", () => {
6
- const isString = new TYPE("string");
7
- const eqHello = new EQ("hello");
8
-
9
- const ifContract = new IF(isString, eqHello);
10
-
11
- test("Should not report infringement when condition matches and inCase is fulfilled", () => {
12
- expect(ifContract.check("hello")).toBe(true);
13
- });
14
-
15
- test("Should report infringement when condition matches but inCase is not fulfilled", () => {
16
- expect(typeof ifContract.check("world")).toBe("string");
17
- });
18
-
19
- test("Should not report infringement when condition does not match", () => {
20
- expect(ifContract.check(42)).toBe(true);
21
- });
22
-
23
- describe("invert", () => {
24
- const invertedContract = new IF(isString, eqHello, true);
25
-
26
- test("Should not report infringement when condition does not match and inCase is fulfilled", () => {
27
- expect(invertedContract.check("hello")).toBe(true);
28
- });
29
-
30
- test("Should report infringement when condition does not match and inCase is not fulfilled", () => {
31
- expect(typeof invertedContract.check(42)).toBe("string");
32
- });
33
-
34
- test("Should not report infringement when condition matches", () => {
35
- expect(invertedContract.check("world")).toBe(true);
36
- });
37
- });
38
-
39
- describe("checkAlgorithm", () => {
40
- test("Should return true when condition not met", () => {
41
- expect(IF.checkAlgorithm(123, isString, eqHello)).toBe(true);
42
- });
43
-
44
- test("Should return string when condition met but inCase fails", () => {
45
- expect(typeof IF.checkAlgorithm("notHello", isString, eqHello)).toBe(
46
- "string",
47
- );
48
- });
49
-
50
- test("Should return true when both condition and inCase pass", () => {
51
- expect(IF.checkAlgorithm("hello", isString, eqHello)).toBe(true);
52
- });
53
-
54
- test("Should return true when toCheck is undefined", () => {
55
- expect(IF.checkAlgorithm(undefined, isString, eqHello)).toBe(true);
56
- });
57
-
58
- test("Should return true when toCheck is null", () => {
59
- expect(IF.checkAlgorithm(null, isString, eqHello)).toBe(true);
60
- });
61
- });
62
- });
1
+ import { EQ } from "../../src/DBC/EQ";
2
+ import { IF } from "../../src/DBC/IF";
3
+ import { TYPE } from "../../src/DBC/TYPE";
4
+
5
+ describe("IF", () => {
6
+ const isString = new TYPE("string");
7
+ const eqHello = new EQ("hello");
8
+
9
+ const ifContract = new IF(isString, eqHello);
10
+
11
+ test("Should not report infringement when condition matches and inCase is fulfilled", () => {
12
+ expect(ifContract.check("hello")).toBe(true);
13
+ });
14
+
15
+ test("Should report infringement when condition matches but inCase is not fulfilled", () => {
16
+ expect(typeof ifContract.check("world")).toBe("string");
17
+ });
18
+
19
+ test("Should not report infringement when condition does not match", () => {
20
+ expect(ifContract.check(42)).toBe(true);
21
+ });
22
+
23
+ describe("invert", () => {
24
+ const invertedContract = new IF(isString, eqHello, true);
25
+
26
+ test("Should not report infringement when condition does not match and inCase is fulfilled", () => {
27
+ expect(invertedContract.check("hello")).toBe(true);
28
+ });
29
+
30
+ test("Should report infringement when condition does not match and inCase is not fulfilled", () => {
31
+ expect(typeof invertedContract.check(42)).toBe("string");
32
+ });
33
+
34
+ test("Should not report infringement when condition matches", () => {
35
+ expect(invertedContract.check("world")).toBe(true);
36
+ });
37
+ });
38
+
39
+ describe("checkAlgorithm", () => {
40
+ test("Should return true when condition not met", () => {
41
+ expect(IF.checkAlgorithm(123, isString, eqHello)).toBe(true);
42
+ });
43
+
44
+ test("Should return string when condition met but inCase fails", () => {
45
+ expect(typeof IF.checkAlgorithm("notHello", isString, eqHello)).toBe(
46
+ "string",
47
+ );
48
+ });
49
+
50
+ test("Should return true when both condition and inCase pass", () => {
51
+ expect(IF.checkAlgorithm("hello", isString, eqHello)).toBe(true);
52
+ });
53
+
54
+ test("Should return true when toCheck is undefined", () => {
55
+ expect(IF.checkAlgorithm(undefined, isString, eqHello)).toBe(true);
56
+ });
57
+
58
+ test("Should return true when toCheck is null", () => {
59
+ expect(IF.checkAlgorithm(null, isString, eqHello)).toBe(true);
60
+ });
61
+ });
62
+ });
@@ -1,13 +1,13 @@
1
- import { INSTANCE } from "../../src/DBC/INSTANCE";
2
-
3
- describe("INSTANCE", () => {
4
- const instance = new INSTANCE(RegExp);
5
-
6
- test("Should not report infringement with '/a/g' to check", () => {
7
- expect(instance.check(/a/g)).toBe(true);
8
- });
9
-
10
- test("Should report infringement with 'd' to check", () => {
11
- expect(typeof instance.check("d")).toBe("string");
12
- });
13
- });
1
+ import { INSTANCE } from "../../src/DBC/INSTANCE";
2
+
3
+ describe("INSTANCE", () => {
4
+ const instance = new INSTANCE(RegExp);
5
+
6
+ test("Should not report infringement with '/a/g' to check", () => {
7
+ expect(instance.check(/a/g)).toBe(true);
8
+ });
9
+
10
+ test("Should report infringement with 'd' to check", () => {
11
+ expect(typeof instance.check("d")).toBe("string");
12
+ });
13
+ });
@@ -1,47 +1,47 @@
1
- import { JSON_OP } from "../../src/DBC/JSON.OP";
2
-
3
- describe("JSON.OP", () => {
4
- const jsonOP = new JSON_OP([
5
- { name: "x", type: "string" },
6
- { name: "y", type: "number" },
7
- ]);
8
-
9
- test("Should not report infringement with { x: 'x', y: 1 } to check", () => {
10
- expect(jsonOP.check({ x: "x", y: 1 })).toBe(true);
11
- });
12
-
13
- test("Should report infringement with { x: 1 } to check", () => {
14
- expect(typeof jsonOP.check({ x: 1 })).toBe("string");
15
- });
16
-
17
- test("Should not report infringement with [{ x: 'x', y: 1 },{ x: 'xs', y: 2 }] to check in 'checkElements' mode", () => {
18
- expect(
19
- new JSON_OP(
20
- [
21
- { name: "x", type: "string" },
22
- { name: "y", type: "number" },
23
- ],
24
- true,
25
- ).check([
26
- { x: "x", y: 1 },
27
- { x: "xs", y: 2 },
28
- ]),
29
- ).toBe(true);
30
- });
31
-
32
- test("Should report infringement with [{ x: 'x', y: 1 },{ x: 'xs', y: 2 }] to check with no 'checkElements' mode", () => {
33
- expect(
34
- typeof new JSON_OP([
35
- { name: "x", type: "string" },
36
- { name: "y", type: "number" },
37
- ]).check([
38
- { x: "x", y: 1 },
39
- { x: "xs", y: 2 },
40
- ]),
41
- ).toBe("string");
42
- });
43
-
44
- test("Should report infringement with [] to check", () => {
45
- expect(typeof jsonOP.check([])).toBe("string");
46
- });
47
- });
1
+ import { JSON_OP } from "../../src/DBC/JSON.OP";
2
+
3
+ describe("JSON.OP", () => {
4
+ const jsonOP = new JSON_OP([
5
+ { name: "x", type: "string" },
6
+ { name: "y", type: "number" },
7
+ ]);
8
+
9
+ test("Should not report infringement with { x: 'x', y: 1 } to check", () => {
10
+ expect(jsonOP.check({ x: "x", y: 1 })).toBe(true);
11
+ });
12
+
13
+ test("Should report infringement with { x: 1 } to check", () => {
14
+ expect(typeof jsonOP.check({ x: 1 })).toBe("string");
15
+ });
16
+
17
+ test("Should not report infringement with [{ x: 'x', y: 1 },{ x: 'xs', y: 2 }] to check in 'checkElements' mode", () => {
18
+ expect(
19
+ new JSON_OP(
20
+ [
21
+ { name: "x", type: "string" },
22
+ { name: "y", type: "number" },
23
+ ],
24
+ true,
25
+ ).check([
26
+ { x: "x", y: 1 },
27
+ { x: "xs", y: 2 },
28
+ ]),
29
+ ).toBe(true);
30
+ });
31
+
32
+ test("Should report infringement with [{ x: 'x', y: 1 },{ x: 'xs', y: 2 }] to check with no 'checkElements' mode", () => {
33
+ expect(
34
+ typeof new JSON_OP([
35
+ { name: "x", type: "string" },
36
+ { name: "y", type: "number" },
37
+ ]).check([
38
+ { x: "x", y: 1 },
39
+ { x: "xs", y: 2 },
40
+ ]),
41
+ ).toBe("string");
42
+ });
43
+
44
+ test("Should report infringement with [] to check", () => {
45
+ expect(typeof jsonOP.check([])).toBe("string");
46
+ });
47
+ });
@@ -1,17 +1,17 @@
1
- import { JSON_Parse } from "../../src/DBC/JSON.Parse";
2
-
3
- describe("JSON_Parse", () => {
4
- const jsonParse = new JSON_Parse();
5
-
6
- test(`Should not report infringement with '{"d":"o"}' to check`, () => {
7
- expect(jsonParse.check('{"d":"o"}')).toBe(true);
8
- });
9
-
10
- test(`Should report infringement with '{"d":o}' to check`, () => {
11
- expect(typeof jsonParse.check('{"d":o}')).toBe("string");
12
- });
13
-
14
- test(`Should not report infringement or throw "referenceException" with '{"d":"o"}' to check and "receptor" not defined`, () => {
15
- expect(new JSON_Parse().check('{"d":"o"}')).toBe(true);
16
- });
17
- });
1
+ import { JSON_Parse } from "../../src/DBC/JSON.Parse";
2
+
3
+ describe("JSON_Parse", () => {
4
+ const jsonParse = new JSON_Parse();
5
+
6
+ test(`Should not report infringement with '{"d":"o"}' to check`, () => {
7
+ expect(jsonParse.check('{"d":"o"}')).toBe(true);
8
+ });
9
+
10
+ test(`Should report infringement with '{"d":o}' to check`, () => {
11
+ expect(typeof jsonParse.check('{"d":o}')).toBe("string");
12
+ });
13
+
14
+ test(`Should not report infringement or throw "referenceException" with '{"d":"o"}' to check and "receptor" not defined`, () => {
15
+ expect(new JSON_Parse().check('{"d":"o"}')).toBe(true);
16
+ });
17
+ });
@@ -1,14 +1,14 @@
1
- import { EQ } from "../../src/DBC/EQ";
2
- import { OR } from "../../src/DBC/OR";
3
-
4
- describe("OR", () => {
5
- const or = new OR([new EQ("a"), new EQ("b")]);
6
-
7
- test("Should not report infringement with 'b' to check", () => {
8
- expect(or.check("b")).toBe(true);
9
- });
10
-
11
- test("Should report infringement with 'c' to check", () => {
12
- expect(typeof or.check("c")).toBe("string");
13
- });
14
- });
1
+ import { EQ } from "../../src/DBC/EQ";
2
+ import { OR } from "../../src/DBC/OR";
3
+
4
+ describe("OR", () => {
5
+ const or = new OR([new EQ("a"), new EQ("b")]);
6
+
7
+ test("Should not report infringement with 'b' to check", () => {
8
+ expect(or.check("b")).toBe(true);
9
+ });
10
+
11
+ test("Should report infringement with 'c' to check", () => {
12
+ expect(typeof or.check("c")).toBe("string");
13
+ });
14
+ });