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.
- package/.gitattributes +16 -8
- package/.vscode/settings.json +3 -3
- package/.vscode/tasks.json +23 -23
- package/ASSESSMENT.md +249 -0
- package/README.md +538 -408
- package/__tests__/DBC/AE.test.ts +62 -62
- package/__tests__/DBC/ARRAY.test.ts +91 -91
- package/__tests__/DBC/DEFINED.test.ts +53 -53
- package/__tests__/DBC/DOM.test.ts +786 -0
- package/__tests__/DBC/Decorators.test.ts +367 -367
- package/__tests__/DBC/EQ.test.ts +13 -13
- package/__tests__/DBC/GREATER.test.ts +31 -31
- package/__tests__/DBC/HasAttribute.test.ts +60 -60
- package/__tests__/DBC/IF.test.ts +62 -62
- package/__tests__/DBC/INSTANCE.test.ts +13 -13
- package/__tests__/DBC/JSON.OP.test.ts +47 -47
- package/__tests__/DBC/JSON.Parse.test.ts +17 -17
- package/__tests__/DBC/OR.test.ts +14 -14
- package/__tests__/DBC/PLAIN_OBJECT.test.ts +109 -109
- package/__tests__/DBC/REGEX.test.ts +17 -17
- package/__tests__/DBC/TYPE.test.ts +13 -13
- package/__tests__/DBC/UNDEFINED.test.ts +45 -45
- package/__tests__/DBC/ZOD.test.ts +54 -54
- package/__tests__/DBC/onInfringement.test.ts +262 -0
- package/biome.json +45 -40
- package/dist/DBC/AE.js +172 -0
- package/dist/DBC/ARR/PLAIN_OBJECT.d.ts +0 -3
- package/dist/DBC/ARR/PLAIN_OBJECT.js +95 -0
- package/dist/DBC/ARRAY.d.ts +0 -3
- package/dist/DBC/ARRAY.js +90 -0
- package/dist/DBC/COMPARISON/GREATER.js +21 -0
- package/dist/DBC/COMPARISON/GREATER_OR_EQUAL.js +21 -0
- package/dist/DBC/COMPARISON/LESS.js +21 -0
- package/dist/DBC/COMPARISON/LESS_OR_EQUAL.js +21 -0
- package/dist/DBC/COMPARISON.js +98 -0
- package/dist/DBC/DEFINED.js +87 -0
- package/dist/DBC/DOM.d.ts +123 -0
- package/dist/DBC/DOM.js +362 -0
- package/dist/DBC/EQ/DIFFERENT.js +34 -0
- package/dist/DBC/EQ.js +101 -0
- package/dist/DBC/GREATER.js +99 -0
- package/dist/DBC/HasAttribute.js +101 -0
- package/dist/DBC/IF.js +96 -0
- package/dist/DBC/INSTANCE.js +122 -0
- package/dist/DBC/JSON.OP.js +120 -0
- package/dist/DBC/JSON.Parse.js +104 -0
- package/dist/DBC/OR.js +125 -0
- package/dist/DBC/REGEX.js +136 -0
- package/dist/DBC/TYPE.js +112 -0
- package/dist/DBC/UNDEFINED.js +87 -0
- package/dist/DBC/ZOD.js +99 -0
- package/dist/DBC.d.ts +18 -4
- package/dist/DBC.js +645 -0
- package/dist/Demo.d.ts +10 -0
- package/dist/Demo.js +713 -0
- package/dist/Test.html +18 -0
- package/dist/bundle.js +6140 -405
- package/dist/index.d.ts +22 -0
- package/dist/index.html +18 -0
- package/dist/index.js +22 -0
- package/docs/assets/highlight.css +22 -22
- package/docs/assets/icons.js +17 -17
- package/docs/assets/main.js +60 -60
- package/docs/assets/style.css +1640 -1640
- package/docs/classes/DBC.DBC.html +98 -98
- package/docs/classes/DBC_AE.AE.html +160 -160
- package/docs/classes/DBC_EQ.EQ.html +131 -131
- package/docs/classes/DBC_GREATER.GREATER.html +139 -139
- package/docs/classes/DBC_INSTANCE.INSTANCE.html +130 -130
- package/docs/classes/DBC_JSON.OP.JSON_OP.html +138 -138
- package/docs/classes/DBC_JSON.Parse.JSON_Parse.html +129 -129
- package/docs/classes/DBC_OR.OR.html +137 -137
- package/docs/classes/DBC_REGEX.REGEX.html +136 -136
- package/docs/classes/DBC_TYPE.TYPE.html +130 -130
- package/docs/classes/Demo.Demo.html +14 -14
- package/docs/hierarchy.html +1 -1
- package/docs/index.html +1 -1
- package/docs/modules/DBC.html +1 -1
- package/docs/modules/DBC_AE.html +1 -1
- package/docs/modules/DBC_EQ.html +1 -1
- package/docs/modules/DBC_GREATER.html +1 -1
- package/docs/modules/DBC_INSTANCE.html +1 -1
- package/docs/modules/DBC_JSON.OP.html +1 -1
- package/docs/modules/DBC_JSON.Parse.html +1 -1
- package/docs/modules/DBC_OR.html +1 -1
- package/docs/modules/DBC_REGEX.html +1 -1
- package/docs/modules/DBC_TYPE.html +1 -1
- package/docs/modules/Demo.html +1 -1
- package/jest.config.js +32 -32
- package/package.json +71 -55
- package/src/DBC/AE.ts +269 -288
- package/src/DBC/ARR/PLAIN_OBJECT.ts +122 -133
- package/src/DBC/ARRAY.ts +117 -127
- package/src/DBC/COMPARISON/GREATER.ts +41 -46
- package/src/DBC/COMPARISON/GREATER_OR_EQUAL.ts +41 -45
- package/src/DBC/COMPARISON/LESS.ts +41 -45
- package/src/DBC/COMPARISON/LESS_OR_EQUAL.ts +41 -45
- package/src/DBC/COMPARISON.ts +149 -159
- package/src/DBC/DEFINED.ts +117 -122
- package/src/DBC/DOM.ts +453 -0
- package/src/DBC/EQ/DIFFERENT.ts +51 -57
- package/src/DBC/EQ.ts +154 -163
- package/src/DBC/HasAttribute.ts +149 -154
- package/src/DBC/IF.ts +173 -179
- package/src/DBC/INSTANCE.ts +168 -171
- package/src/DBC/JSON.OP.ts +178 -186
- package/src/DBC/JSON.Parse.ts +150 -157
- package/src/DBC/OR.ts +183 -187
- package/src/DBC/REGEX.ts +195 -196
- package/src/DBC/TYPE.ts +142 -149
- package/src/DBC/UNDEFINED.ts +115 -117
- package/src/DBC/ZOD.ts +130 -135
- package/src/DBC.ts +902 -904
- package/src/Demo.ts +537 -404
- package/src/index.ts +22 -0
- package/tsconfig.json +18 -18
- package/tsconfig.test.json +7 -7
- package/typedoc.json +16 -16
- package/webpack.config.js +27 -27
- package/Assessment.md +0 -507
package/src/Demo.ts
CHANGED
|
@@ -1,404 +1,537 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import {
|
|
6
|
-
import {
|
|
7
|
-
import {
|
|
8
|
-
import {
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
// #region Check
|
|
26
|
-
@REGEX.
|
|
27
|
-
public
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
@
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
// #
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
// #
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
// #
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
// #
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
public
|
|
61
|
-
// #endregion Check
|
|
62
|
-
// #region Check AE
|
|
63
|
-
@DBC.ParamvalueProvider
|
|
64
|
-
public
|
|
65
|
-
@AE.PRE(
|
|
66
|
-
) {}
|
|
67
|
-
// #endregion Check AE
|
|
68
|
-
// #region Check
|
|
69
|
-
@DBC.ParamvalueProvider
|
|
70
|
-
public
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
@DBC.ParamvalueProvider
|
|
88
|
-
public
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
@
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
}
|
|
99
|
-
// #endregion Check
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
console.log(
|
|
155
|
-
console.log("
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
console.log("
|
|
163
|
-
console.log("
|
|
164
|
-
|
|
165
|
-
try {
|
|
166
|
-
demo.
|
|
167
|
-
} catch (X) {
|
|
168
|
-
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
169
|
-
console.log("
|
|
170
|
-
console.log(X);
|
|
171
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
172
|
-
}
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
console.log("
|
|
176
|
-
console.log("
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
console.log(
|
|
183
|
-
console.log("
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
demo.
|
|
203
|
-
|
|
204
|
-
console.log("
|
|
205
|
-
console.log("
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
console.log("
|
|
218
|
-
console.log(
|
|
219
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
console.log("
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
console.log(
|
|
241
|
-
console.log("
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
console.log("
|
|
247
|
-
console.log("
|
|
248
|
-
|
|
249
|
-
try {
|
|
250
|
-
demo.
|
|
251
|
-
} catch (X) {
|
|
252
|
-
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
253
|
-
console.log("
|
|
254
|
-
console.log(X);
|
|
255
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
256
|
-
}
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
console.log("
|
|
260
|
-
console.log("
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
console.log(
|
|
267
|
-
console.log("
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
demo.
|
|
287
|
-
|
|
288
|
-
console.log("
|
|
289
|
-
console.log("
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
console.log("
|
|
302
|
-
console.log(
|
|
303
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
(
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
console.log("
|
|
326
|
-
console.log(
|
|
327
|
-
console.log(
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
console.log("
|
|
340
|
-
console.log("
|
|
341
|
-
|
|
342
|
-
console.log("
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
(
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
console.log(
|
|
356
|
-
console.log("
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
(
|
|
368
|
-
|
|
369
|
-
)
|
|
370
|
-
(
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
console.log("
|
|
385
|
-
console.log("
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
console.log("
|
|
403
|
-
|
|
404
|
-
|
|
1
|
+
import { z } from "zod";
|
|
2
|
+
import { DBC } from "./DBC";
|
|
3
|
+
import { AE } from "./DBC/AE";
|
|
4
|
+
import { PLAIN_OBJECT } from "./DBC/ARR/PLAIN_OBJECT";
|
|
5
|
+
import { ARRAY } from "./DBC/ARRAY";
|
|
6
|
+
import { GREATER } from "./DBC/COMPARISON/GREATER";
|
|
7
|
+
import { GREATER_OR_EQUAL } from "./DBC/COMPARISON/GREATER_OR_EQUAL";
|
|
8
|
+
import { LESS } from "./DBC/COMPARISON/LESS";
|
|
9
|
+
import { LESS_OR_EQUAL } from "./DBC/COMPARISON/LESS_OR_EQUAL";
|
|
10
|
+
import { DEFINED } from "./DBC/DEFINED";
|
|
11
|
+
import { EQ } from "./DBC/EQ";
|
|
12
|
+
import { DIFFERENT } from "./DBC/EQ/DIFFERENT";
|
|
13
|
+
import { HasAttribute } from "./DBC/HasAttribute";
|
|
14
|
+
import { IF } from "./DBC/IF";
|
|
15
|
+
import { INSTANCE } from "./DBC/INSTANCE";
|
|
16
|
+
import { JSON_OP } from "./DBC/JSON.OP";
|
|
17
|
+
import { JSON_Parse } from "./DBC/JSON.Parse";
|
|
18
|
+
import { OR } from "./DBC/OR";
|
|
19
|
+
import { REGEX } from "./DBC/REGEX";
|
|
20
|
+
import { TYPE } from "./DBC/TYPE";
|
|
21
|
+
import { UNDEFINED } from "./DBC/UNDEFINED";
|
|
22
|
+
import { ZOD } from "./DBC/ZOD";
|
|
23
|
+
/** Demonstrative use of **D**esign **B**y **C**ontract Decorators */
|
|
24
|
+
export class Demo {
|
|
25
|
+
// #region Check Property Decorator
|
|
26
|
+
@REGEX.INVARIANT(/^a$/)
|
|
27
|
+
public testProperty = "a";
|
|
28
|
+
// #endregion Check Property Decorator
|
|
29
|
+
// #region Check Parameter. & Returnvalue Decorator
|
|
30
|
+
@REGEX.POST(/^xxxx.*$/)
|
|
31
|
+
@DBC.ParamvalueProvider
|
|
32
|
+
public testParamvalueAndReturnvalue(@REGEX.PRE(/holla*/g) a: string): string {
|
|
33
|
+
return `xxxx${a}`;
|
|
34
|
+
}
|
|
35
|
+
// #endregion Check Parameter. & Returnvalue Decorator
|
|
36
|
+
// #region Check Returnvalue Decorator
|
|
37
|
+
@REGEX.POST(/^xxxx.*$/)
|
|
38
|
+
public testReturnvalue(a: string): string {
|
|
39
|
+
return a;
|
|
40
|
+
}
|
|
41
|
+
// #endregion Check Returnvalue Decorator
|
|
42
|
+
// #region Check EQ-DBC & Path to property of Parameter-value
|
|
43
|
+
@DBC.ParamvalueProvider
|
|
44
|
+
public testEQAndPath(
|
|
45
|
+
@EQ.PRE("SELECT" as unknown as object, false, "tagName") o: HTMLElement,
|
|
46
|
+
) {}
|
|
47
|
+
// #endregion Check EQ-DBC & Path to property of Parameter-value
|
|
48
|
+
// #region Check EQ-DBC & Path to property of Parameter-value with Inversion
|
|
49
|
+
@DBC.ParamvalueProvider
|
|
50
|
+
public testEQAndPathWithInversion(
|
|
51
|
+
@EQ.PRE("SELECT" as unknown as object, true, "tagName") o: HTMLElement,
|
|
52
|
+
) {}
|
|
53
|
+
// #endregion Check EQ-DBC & Path to property of Parameter-value with Inversion
|
|
54
|
+
// #region Check TYPE
|
|
55
|
+
@DBC.ParamvalueProvider
|
|
56
|
+
public testTYPE(@TYPE.PRE("string") o: unknown) {}
|
|
57
|
+
// #endregion Check TYPE
|
|
58
|
+
// #region Check AE
|
|
59
|
+
@DBC.ParamvalueProvider
|
|
60
|
+
public testAE(@AE.PRE([new TYPE("string")]) x: Array<unknown>) {}
|
|
61
|
+
// #endregion Check AE
|
|
62
|
+
// #region Check REGEX with AE
|
|
63
|
+
@DBC.ParamvalueProvider
|
|
64
|
+
public testREGEXWithAE(
|
|
65
|
+
@AE.PRE(new REGEX(/^(?i:(NOW)|([+-]\d+[dmy]))$/i)) x: Array<string>,
|
|
66
|
+
) {}
|
|
67
|
+
// #endregion Check REGEX with AE
|
|
68
|
+
// #region Check INSTANCE
|
|
69
|
+
@DBC.ParamvalueProvider
|
|
70
|
+
public testINSTANCE(@INSTANCE.PRE(Date) candidate: any): undefined {}
|
|
71
|
+
// #endregion Check INSTANCE
|
|
72
|
+
// #region Check AE Range
|
|
73
|
+
@DBC.ParamvalueProvider
|
|
74
|
+
public testAERange(
|
|
75
|
+
@AE.PRE([new TYPE("string"), new REGEX(/^abc$/)], 1, 2) x: Array<unknown>,
|
|
76
|
+
) {}
|
|
77
|
+
// #endregion Check AE Range
|
|
78
|
+
// #region Check AE Index
|
|
79
|
+
@DBC.ParamvalueProvider
|
|
80
|
+
public testAEIndex(
|
|
81
|
+
@AE.PRE([new TYPE("string"), new REGEX(/^abc$/)], 1) x: Array<unknown>,
|
|
82
|
+
) {}
|
|
83
|
+
// #endregion Check AE Index
|
|
84
|
+
// #region Check Comparison
|
|
85
|
+
@DBC.ParamvalueProvider
|
|
86
|
+
public testGREATER(@GREATER.PRE(2) input: number) {}
|
|
87
|
+
@DBC.ParamvalueProvider
|
|
88
|
+
public testGREATER_OR_EQUAL(@GREATER_OR_EQUAL.PRE(2) input: number) {}
|
|
89
|
+
@DBC.ParamvalueProvider
|
|
90
|
+
public testLESS(@LESS.PRE(20) input: number) {}
|
|
91
|
+
@DBC.ParamvalueProvider
|
|
92
|
+
public testLESS_OR_EQUAL(@LESS_OR_EQUAL.PRE(20) input: number) {}
|
|
93
|
+
@DBC.ParamvalueProvider
|
|
94
|
+
public testDIFFERENT(@DIFFERENT.PRE(20) input: number) {}
|
|
95
|
+
// #endregion Check Comparison
|
|
96
|
+
// #region Check ARRAY
|
|
97
|
+
@DBC.ParamvalueProvider
|
|
98
|
+
public testARRAY(@ARRAY.PRE() x: unknown) {}
|
|
99
|
+
// #endregion Check ARRAY
|
|
100
|
+
// #region Check PLAIN_OBJECT
|
|
101
|
+
@DBC.ParamvalueProvider
|
|
102
|
+
public testPLAIN_OBJECT(@PLAIN_OBJECT.PRE() x: unknown) {}
|
|
103
|
+
// #endregion Check PLAIN_OBJECT
|
|
104
|
+
// #region Check DEFINED
|
|
105
|
+
@DBC.ParamvalueProvider
|
|
106
|
+
public testDEFINED(@DEFINED.PRE() x: unknown) {}
|
|
107
|
+
// #endregion Check DEFINED
|
|
108
|
+
// #region Check UNDEFINED
|
|
109
|
+
@DBC.ParamvalueProvider
|
|
110
|
+
public testUNDEFINED(@UNDEFINED.PRE() x: unknown) {}
|
|
111
|
+
// #endregion Check UNDEFINED
|
|
112
|
+
// #region Check HasAttribute
|
|
113
|
+
@DBC.ParamvalueProvider
|
|
114
|
+
public testHasAttribute(@HasAttribute.PRE("data-test") el: HTMLElement) {}
|
|
115
|
+
// #endregion Check HasAttribute
|
|
116
|
+
// #region Check IF
|
|
117
|
+
@DBC.ParamvalueProvider
|
|
118
|
+
public testIF(@IF.PRE(new TYPE("string"), new REGEX(/^hello/)) x: unknown) {}
|
|
119
|
+
// #endregion Check IF
|
|
120
|
+
// #region Check OR
|
|
121
|
+
@DBC.ParamvalueProvider
|
|
122
|
+
public testOR(@OR.PRE([new TYPE("string"), new TYPE("number")]) x: unknown) {}
|
|
123
|
+
// #endregion Check OR
|
|
124
|
+
// #region Check JSON_OP
|
|
125
|
+
@DBC.ParamvalueProvider
|
|
126
|
+
public testJSON_OP(
|
|
127
|
+
@JSON_OP.PRE([{ name: "id", type: "number" }]) x: unknown,
|
|
128
|
+
) {}
|
|
129
|
+
// #endregion Check JSON_OP
|
|
130
|
+
// #region Check JSON_Parse
|
|
131
|
+
@DBC.ParamvalueProvider
|
|
132
|
+
public testJSON_Parse(@JSON_Parse.PRE((_json) => {}) x: string) {}
|
|
133
|
+
// #endregion Check JSON_Parse
|
|
134
|
+
// #region Check ZOD
|
|
135
|
+
@DBC.ParamvalueProvider
|
|
136
|
+
public testZOD(@ZOD.PRE(z.string()) x: unknown) {}
|
|
137
|
+
// #endregion Check ZOD
|
|
138
|
+
// #region Check Static Method with ParamvalueProvider
|
|
139
|
+
@DBC.ParamvalueProvider
|
|
140
|
+
public static testStaticMethod(
|
|
141
|
+
@TYPE.PRE("string") message: string,
|
|
142
|
+
@TYPE.PRE("number") count: number,
|
|
143
|
+
): string {
|
|
144
|
+
return `${message} repeated ${count} times`;
|
|
145
|
+
}
|
|
146
|
+
// #endregion Check Static Method with ParamvalueProvider
|
|
147
|
+
}
|
|
148
|
+
const demo = new Demo();
|
|
149
|
+
try {
|
|
150
|
+
demo.testProperty = "abd";
|
|
151
|
+
} catch (X) {
|
|
152
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
153
|
+
console.log("INVARIANT Infringement", "OK");
|
|
154
|
+
console.log(X);
|
|
155
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
156
|
+
}
|
|
157
|
+
demo.testProperty = "a";
|
|
158
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
159
|
+
console.log("INVARIANT OK");
|
|
160
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
161
|
+
demo.testParamvalueAndReturnvalue("holla");
|
|
162
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
163
|
+
console.log("PARAMETER- & RETURNVALUE OK");
|
|
164
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
165
|
+
try {
|
|
166
|
+
demo.testParamvalueAndReturnvalue("yyyy");
|
|
167
|
+
} catch (X) {
|
|
168
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
169
|
+
console.log("PARAMETER- & RETURNVALUE Infringement", "OK");
|
|
170
|
+
console.log(X);
|
|
171
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
172
|
+
}
|
|
173
|
+
demo.testReturnvalue("xxxx");
|
|
174
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
175
|
+
console.log("RETURNVALUE OK");
|
|
176
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
177
|
+
try {
|
|
178
|
+
demo.testReturnvalue("yyyy");
|
|
179
|
+
} catch (X) {
|
|
180
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
181
|
+
console.log("RETURNVALUE Infringement", "OK");
|
|
182
|
+
console.log(X);
|
|
183
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
184
|
+
}
|
|
185
|
+
demo.testEQAndPath(document.createElement("select"));
|
|
186
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
187
|
+
console.log("EQ with Path Infringement OK");
|
|
188
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
189
|
+
try {
|
|
190
|
+
demo.testEQAndPathWithInversion(document.createElement("select"));
|
|
191
|
+
} catch (X) {
|
|
192
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
193
|
+
console.log("EQ with Path and Inversion Infringement OK");
|
|
194
|
+
console.log(X);
|
|
195
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
196
|
+
}
|
|
197
|
+
demo.testTYPE("x");
|
|
198
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
199
|
+
console.log("TYPE OK");
|
|
200
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
201
|
+
try {
|
|
202
|
+
demo.testTYPE(0);
|
|
203
|
+
} catch (X) {
|
|
204
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
205
|
+
console.log("TYPE Infringement OK");
|
|
206
|
+
console.log(X);
|
|
207
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
208
|
+
}
|
|
209
|
+
demo.testAE(["11", "10", "b"]);
|
|
210
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
211
|
+
console.log("AE OK");
|
|
212
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
213
|
+
try {
|
|
214
|
+
demo.testAE(["11", 11, "b"]);
|
|
215
|
+
} catch (X) {
|
|
216
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
217
|
+
console.log("AE Infringement OK");
|
|
218
|
+
console.log(X);
|
|
219
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
220
|
+
}
|
|
221
|
+
demo.testREGEXWithAE(["+1d", "NOW", "-10y"]);
|
|
222
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
223
|
+
console.log("REGEX with AE OK");
|
|
224
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
225
|
+
try {
|
|
226
|
+
demo.testREGEXWithAE(["+1d", "+5d", "-x10y"]);
|
|
227
|
+
} catch (X) {
|
|
228
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
229
|
+
console.log("REGEX with AE Infringement OK");
|
|
230
|
+
console.log(X);
|
|
231
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
232
|
+
}
|
|
233
|
+
demo.testINSTANCE(new Date());
|
|
234
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
235
|
+
console.log("INSTANCE OK");
|
|
236
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
237
|
+
try {
|
|
238
|
+
demo.testINSTANCE(demo);
|
|
239
|
+
} catch (X) {
|
|
240
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
241
|
+
console.log("INSTANCE Infringement OK");
|
|
242
|
+
console.log(X);
|
|
243
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
244
|
+
}
|
|
245
|
+
demo.testAERange([11, "abc", "abc"]);
|
|
246
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
247
|
+
console.log("AE Range OK");
|
|
248
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
249
|
+
try {
|
|
250
|
+
demo.testAERange([11, "abc", /a/g]);
|
|
251
|
+
} catch (X) {
|
|
252
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
253
|
+
console.log("AE Range Infringement OK");
|
|
254
|
+
console.log(X);
|
|
255
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
256
|
+
}
|
|
257
|
+
demo.testAEIndex([11, "abc", "abc"]);
|
|
258
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
259
|
+
console.log("AE Index OK");
|
|
260
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
261
|
+
try {
|
|
262
|
+
demo.testAEIndex(["11", 12, "/a/g"]);
|
|
263
|
+
} catch (X) {
|
|
264
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
265
|
+
console.log("AE Index Infringement OK");
|
|
266
|
+
console.log(X);
|
|
267
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
268
|
+
}
|
|
269
|
+
demo.testGREATER(11);
|
|
270
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
271
|
+
console.log("GREATER OK");
|
|
272
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
273
|
+
try {
|
|
274
|
+
demo.testGREATER(2);
|
|
275
|
+
} catch (X) {
|
|
276
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
277
|
+
console.log("GREATER Infringement OK");
|
|
278
|
+
console.log(X);
|
|
279
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
280
|
+
}
|
|
281
|
+
demo.testGREATER_OR_EQUAL(2);
|
|
282
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
283
|
+
console.log("GREATER_OR_EQUAL OK");
|
|
284
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
285
|
+
try {
|
|
286
|
+
demo.testGREATER_OR_EQUAL(1);
|
|
287
|
+
} catch (X) {
|
|
288
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
289
|
+
console.log("GREATER_OR_EQUAL Infringement OK");
|
|
290
|
+
console.log(X);
|
|
291
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
292
|
+
}
|
|
293
|
+
demo.testLESS(10);
|
|
294
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
295
|
+
console.log("LESS OK");
|
|
296
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
297
|
+
try {
|
|
298
|
+
demo.testLESS(20);
|
|
299
|
+
} catch (X) {
|
|
300
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
301
|
+
console.log("LESS Infringement OK");
|
|
302
|
+
console.log(X);
|
|
303
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
304
|
+
}
|
|
305
|
+
demo.testLESS_OR_EQUAL(20);
|
|
306
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
307
|
+
console.log("LESS OK");
|
|
308
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
309
|
+
try {
|
|
310
|
+
demo.testLESS_OR_EQUAL(21);
|
|
311
|
+
} catch (X) {
|
|
312
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
313
|
+
console.log("LESS_OR_EQUAL Infringement OK");
|
|
314
|
+
console.log(X);
|
|
315
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
316
|
+
}
|
|
317
|
+
demo.testDIFFERENT(21);
|
|
318
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
319
|
+
console.log("DIFFERENT OK");
|
|
320
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
321
|
+
try {
|
|
322
|
+
demo.testDIFFERENT(20);
|
|
323
|
+
} catch (X) {
|
|
324
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
325
|
+
console.log("DIFFERENT Infringement OK");
|
|
326
|
+
console.log(X);
|
|
327
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
328
|
+
}
|
|
329
|
+
// #region Inactivity Checks
|
|
330
|
+
(
|
|
331
|
+
window as unknown as { [key: string]: { DBC: DBC } }
|
|
332
|
+
).WaXCode.DBC.executionSettings.checkPreconditions = false;
|
|
333
|
+
try {
|
|
334
|
+
demo.testLESS_OR_EQUAL(21);
|
|
335
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
336
|
+
console.log("INACTIVE PRECONDITIONS OK");
|
|
337
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
338
|
+
} catch (X) {
|
|
339
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
340
|
+
console.log("INACTIVE PRECONDITIONS FAILED");
|
|
341
|
+
console.log(X);
|
|
342
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
343
|
+
}
|
|
344
|
+
(
|
|
345
|
+
window as unknown as { [key: string]: { DBC: DBC } }
|
|
346
|
+
).WaXCode.DBC.executionSettings.checkPostconditions = false;
|
|
347
|
+
try {
|
|
348
|
+
demo.testReturnvalue("qqqqq");
|
|
349
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
350
|
+
console.log("INACTIVE POSTCONDITIONS OK");
|
|
351
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
352
|
+
} catch (X) {
|
|
353
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
354
|
+
console.log("INACTIVE POSTCONDITIONS FAILED");
|
|
355
|
+
console.log(X);
|
|
356
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
357
|
+
}
|
|
358
|
+
(
|
|
359
|
+
window as unknown as { [key: string]: { DBC: DBC } }
|
|
360
|
+
).WaXCode.DBC.executionSettings.checkInvariants = false;
|
|
361
|
+
try {
|
|
362
|
+
demo.testProperty = "b";
|
|
363
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
364
|
+
console.log("INACTIVE INVARIANTS OK");
|
|
365
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
366
|
+
} catch (X) {
|
|
367
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
368
|
+
console.log("INACTIVE INVARIANTS FAILED");
|
|
369
|
+
console.log(X);
|
|
370
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
371
|
+
}
|
|
372
|
+
// #endregion Inactivity Checks
|
|
373
|
+
// Re-enable all checks for subsequent tests
|
|
374
|
+
(
|
|
375
|
+
window as unknown as { [key: string]: { DBC: DBC } }
|
|
376
|
+
).WaXCode.DBC.executionSettings.checkPreconditions = true;
|
|
377
|
+
(
|
|
378
|
+
window as unknown as { [key: string]: { DBC: DBC } }
|
|
379
|
+
).WaXCode.DBC.executionSettings.checkPostconditions = true;
|
|
380
|
+
(
|
|
381
|
+
window as unknown as { [key: string]: { DBC: DBC } }
|
|
382
|
+
).WaXCode.DBC.executionSettings.checkInvariants = true;
|
|
383
|
+
// #region Static Method Test
|
|
384
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
385
|
+
console.log("TESTING STATIC METHOD WITH PARAMVALUEPROVIDER");
|
|
386
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
387
|
+
Demo.testStaticMethod("Hello", 3);
|
|
388
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
389
|
+
console.log("STATIC METHOD OK");
|
|
390
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
391
|
+
try {
|
|
392
|
+
Demo.testStaticMethod("Hello", "not a number" as unknown as number);
|
|
393
|
+
} catch (X) {
|
|
394
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
395
|
+
console.log("STATIC METHOD Infringement OK");
|
|
396
|
+
console.log(X);
|
|
397
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
398
|
+
}
|
|
399
|
+
try {
|
|
400
|
+
Demo.testStaticMethod(123 as unknown as string, 5);
|
|
401
|
+
} catch (X) {
|
|
402
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
403
|
+
console.log("STATIC METHOD Infringement (first param) OK");
|
|
404
|
+
console.log(X);
|
|
405
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
406
|
+
}
|
|
407
|
+
// #endregion Static Method Test
|
|
408
|
+
demo.testARRAY([1, 2, 3]);
|
|
409
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
410
|
+
console.log("ARRAY OK");
|
|
411
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
412
|
+
try {
|
|
413
|
+
demo.testARRAY("not an array");
|
|
414
|
+
} catch (X) {
|
|
415
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
416
|
+
console.log("ARRAY Infringement OK");
|
|
417
|
+
console.log(X);
|
|
418
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
419
|
+
}
|
|
420
|
+
demo.testPLAIN_OBJECT({ key: "value" });
|
|
421
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
422
|
+
console.log("PLAIN_OBJECT OK");
|
|
423
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
424
|
+
try {
|
|
425
|
+
demo.testPLAIN_OBJECT([1, 2, 3]);
|
|
426
|
+
} catch (X) {
|
|
427
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
428
|
+
console.log("PLAIN_OBJECT Infringement OK");
|
|
429
|
+
console.log(X);
|
|
430
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
431
|
+
}
|
|
432
|
+
demo.testDEFINED("something");
|
|
433
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
434
|
+
console.log("DEFINED OK");
|
|
435
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
436
|
+
try {
|
|
437
|
+
demo.testDEFINED(null);
|
|
438
|
+
} catch (X) {
|
|
439
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
440
|
+
console.log("DEFINED Infringement OK");
|
|
441
|
+
console.log(X);
|
|
442
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
443
|
+
}
|
|
444
|
+
demo.testUNDEFINED(undefined);
|
|
445
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
446
|
+
console.log("UNDEFINED OK");
|
|
447
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
448
|
+
try {
|
|
449
|
+
demo.testUNDEFINED("not undefined");
|
|
450
|
+
} catch (X) {
|
|
451
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
452
|
+
console.log("UNDEFINED Infringement OK");
|
|
453
|
+
console.log(X);
|
|
454
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
455
|
+
}
|
|
456
|
+
const elWithAttr = document.createElement("div");
|
|
457
|
+
elWithAttr.setAttribute("data-test", "");
|
|
458
|
+
demo.testHasAttribute(elWithAttr);
|
|
459
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
460
|
+
console.log("HasAttribute OK");
|
|
461
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
462
|
+
try {
|
|
463
|
+
demo.testHasAttribute(document.createElement("div"));
|
|
464
|
+
} catch (X) {
|
|
465
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
466
|
+
console.log("HasAttribute Infringement OK");
|
|
467
|
+
console.log(X);
|
|
468
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
469
|
+
}
|
|
470
|
+
demo.testIF(42);
|
|
471
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
472
|
+
console.log("IF OK (non-string, condition not triggered)");
|
|
473
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
474
|
+
demo.testIF("helloWorld");
|
|
475
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
476
|
+
console.log("IF OK (string matching regex)");
|
|
477
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
478
|
+
try {
|
|
479
|
+
demo.testIF("world");
|
|
480
|
+
} catch (X) {
|
|
481
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
482
|
+
console.log("IF Infringement OK (string not matching regex)");
|
|
483
|
+
console.log(X);
|
|
484
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
485
|
+
}
|
|
486
|
+
demo.testOR("hello");
|
|
487
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
488
|
+
console.log("OR OK (string)");
|
|
489
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
490
|
+
demo.testOR(42);
|
|
491
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
492
|
+
console.log("OR OK (number)");
|
|
493
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
494
|
+
try {
|
|
495
|
+
demo.testOR(true);
|
|
496
|
+
} catch (X) {
|
|
497
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
498
|
+
console.log("OR Infringement OK");
|
|
499
|
+
console.log(X);
|
|
500
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
501
|
+
}
|
|
502
|
+
demo.testJSON_OP({ id: 1 });
|
|
503
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
504
|
+
console.log("JSON_OP OK");
|
|
505
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
506
|
+
try {
|
|
507
|
+
demo.testJSON_OP({ name: "missing id" });
|
|
508
|
+
} catch (X) {
|
|
509
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
510
|
+
console.log("JSON_OP Infringement OK");
|
|
511
|
+
console.log(X);
|
|
512
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
513
|
+
}
|
|
514
|
+
demo.testJSON_Parse('{"key":"value"}');
|
|
515
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
516
|
+
console.log("JSON_Parse OK");
|
|
517
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
518
|
+
try {
|
|
519
|
+
demo.testJSON_Parse("not valid json{");
|
|
520
|
+
} catch (X) {
|
|
521
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
522
|
+
console.log("JSON_Parse Infringement OK");
|
|
523
|
+
console.log(X);
|
|
524
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
525
|
+
}
|
|
526
|
+
demo.testZOD("hello");
|
|
527
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
528
|
+
console.log("ZOD OK");
|
|
529
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
530
|
+
try {
|
|
531
|
+
demo.testZOD(42);
|
|
532
|
+
} catch (X) {
|
|
533
|
+
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
534
|
+
console.log("ZOD Infringement OK");
|
|
535
|
+
console.log(X);
|
|
536
|
+
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
537
|
+
}
|