xdbc 1.0.207 → 1.0.209
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/Assessment.html +350 -0
- package/Assessment.md +507 -51
- package/CHANGELOG.md +55 -0
- package/CONTRIBUTING.md +129 -17
- package/README.md +373 -71
- package/SECURITY.md +60 -18
- package/SUPPORT.md +65 -0
- package/__tests__/DBC/DEFINED.test.ts +53 -0
- package/__tests__/DBC/Decorators.test.ts +365 -0
- package/__tests__/DBC/GREATER.test.ts +8 -6
- package/__tests__/DBC/HasAttribute.test.ts +56 -0
- package/__tests__/DBC/IF.test.ts +52 -0
- package/__tests__/DBC/JSON.Parse.test.ts +1 -1
- package/__tests__/DBC/OR.test.ts +1 -1
- package/__tests__/DBC/REGEX.test.ts +1 -1
- package/__tests__/DBC/TYPE.test.ts +1 -1
- package/__tests__/DBC/UNDEFINED.test.ts +45 -0
- package/__tests__/DBC/ZOD.test.ts +54 -0
- package/jest.config.js +21 -0
- package/package.json +4 -5
- package/src/DBC/AE.ts +10 -6
- package/src/DBC/COMPARISON/GREATER.ts +11 -7
- package/src/DBC/COMPARISON/GREATER_OR_EQUAL.ts +14 -10
- package/src/DBC/COMPARISON/LESS.ts +14 -10
- package/src/DBC/COMPARISON/LESS_OR_EQUAL.ts +14 -10
- package/src/DBC/COMPARISON.ts +20 -43
- package/src/DBC/DEFINED.ts +4 -23
- package/src/DBC/EQ/DIFFERENT.ts +21 -56
- package/src/DBC/EQ.ts +7 -26
- package/src/DBC/HasAttribute.ts +9 -26
- package/src/DBC/IF.ts +8 -27
- package/src/DBC/INSTANCE.ts +5 -22
- package/src/DBC/JSON.OP.ts +4 -34
- package/src/DBC/JSON.Parse.ts +5 -25
- package/src/DBC/OR.ts +5 -14
- package/src/DBC/REGEX.ts +41 -40
- package/src/DBC/TYPE.ts +6 -25
- package/src/DBC/UNDEFINED.ts +3 -22
- package/src/DBC/ZOD.ts +10 -27
- package/src/DBC.ts +223 -55
- package/tsconfig.json +7 -4
- package/tsconfig.test.json +12 -0
- package/.parcel-cache/bf96c58b6061a62a-BundleGraph +0 -0
- package/.parcel-cache/d7c812d65aeeac59-AssetGraph +0 -0
- package/.parcel-cache/data.mdb +0 -0
- package/.parcel-cache/e81759c1f106a17f-RequestGraph +0 -0
- package/.parcel-cache/fe0db3c4eb428be2-AssetGraph +0 -0
- package/.parcel-cache/lock.mdb +0 -0
- package/.parcel-cache/snapshot-e81759c1f106a17f.txt +0 -4609
- package/dist/DBC/AE.js +0 -173
- package/dist/DBC/COMPARISON/GREATER.js +0 -21
- package/dist/DBC/COMPARISON/GREATER_OR_EQUAL.js +0 -21
- package/dist/DBC/COMPARISON/LESS.js +0 -21
- package/dist/DBC/COMPARISON/LESS_OR_EQUAL.js +0 -21
- package/dist/DBC/COMPARISON.js +0 -99
- package/dist/DBC/DEFINED.js +0 -99
- package/dist/DBC/EQ/DIFFERENT.js +0 -21
- package/dist/DBC/EQ.js +0 -100
- package/dist/DBC/GREATER.js +0 -99
- package/dist/DBC/HasAttribute.js +0 -108
- package/dist/DBC/IF.js +0 -99
- package/dist/DBC/INSTANCE.js +0 -93
- package/dist/DBC/JSON.OP.js +0 -133
- package/dist/DBC/JSON.Parse.js +0 -114
- package/dist/DBC/OR.js +0 -113
- package/dist/DBC/REGEX.js +0 -110
- package/dist/DBC/TYPE.js +0 -87
- package/dist/DBC/ZOD.js +0 -114
- package/dist/DBC.js +0 -336
- package/dist/Demo.js +0 -290
- package/dist/Test.html +0 -18
- package/dist/bundle.js +0 -2064
- package/dist/index.html +0 -18
- package/jest.config.ts +0 -20
- package/xpackage-lock.json +0 -122
package/dist/DBC.js
DELETED
|
@@ -1,336 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Provides a **D**esign **B**y **C**ontract Framework using decorators.
|
|
3
|
-
*
|
|
4
|
-
* @remarks
|
|
5
|
-
* Maintainer: Callari, Salvatore (XDBC@WaXCode.net) */
|
|
6
|
-
export class DBC {
|
|
7
|
-
/**
|
|
8
|
-
* Make a request to get the value of a certain parameter of specific method in a specific {@link object }.
|
|
9
|
-
* That request gets enlisted in {@link paramValueRequests } which is used by {@link ParamvalueProvider} to invoke the
|
|
10
|
-
* given "receptor" with the parameter value stored in there. Thus a parameter decorator using this method will
|
|
11
|
-
* not receive any value of the top method is not tagged with {@link ParamvalueProvider}.
|
|
12
|
-
*
|
|
13
|
-
* @param target The {@link object } containing the method with the parameter which's value is requested.
|
|
14
|
-
* @param methodName The name of the method with the parameter which's value is requested.
|
|
15
|
-
* @param index The index of the parameter which's value is requested.
|
|
16
|
-
* @param receptor The method the requested parameter-value shall be passed to when it becomes available. */
|
|
17
|
-
static requestParamValue(target, methodName, index,
|
|
18
|
-
// biome-ignore lint/suspicious/noExplicitAny: Gotta be any since parameter-values may be undefined.
|
|
19
|
-
receptor) {
|
|
20
|
-
if (DBC.paramValueRequests.has(target)) {
|
|
21
|
-
if (DBC.paramValueRequests.get(target).has(methodName)) {
|
|
22
|
-
if (DBC.paramValueRequests.get(target).get(methodName).has(index)) {
|
|
23
|
-
DBC.paramValueRequests
|
|
24
|
-
.get(target)
|
|
25
|
-
.get(methodName)
|
|
26
|
-
.get(index)
|
|
27
|
-
.push(receptor);
|
|
28
|
-
}
|
|
29
|
-
else {
|
|
30
|
-
DBC.paramValueRequests
|
|
31
|
-
.get(target)
|
|
32
|
-
.get(methodName)
|
|
33
|
-
.set(index, new Array(receptor));
|
|
34
|
-
}
|
|
35
|
-
}
|
|
36
|
-
else {
|
|
37
|
-
DBC.paramValueRequests
|
|
38
|
-
.get(target)
|
|
39
|
-
.set(methodName, new Map([
|
|
40
|
-
[index, new Array(receptor)],
|
|
41
|
-
]));
|
|
42
|
-
}
|
|
43
|
-
}
|
|
44
|
-
else {
|
|
45
|
-
DBC.paramValueRequests.set(target, new Map([
|
|
46
|
-
[
|
|
47
|
-
methodName,
|
|
48
|
-
new Map([
|
|
49
|
-
[index, new Array(receptor)],
|
|
50
|
-
]),
|
|
51
|
-
],
|
|
52
|
-
]));
|
|
53
|
-
}
|
|
54
|
-
return undefined;
|
|
55
|
-
}
|
|
56
|
-
/**
|
|
57
|
-
* A method-decorator factory checking the {@link paramValueRequests } for value-requests of the method's parameter thus
|
|
58
|
-
* also usable on setters.
|
|
59
|
-
* When found it will invoke the "receptor" registered there, inter alia by {@link requestParamValue }, with the
|
|
60
|
-
* parameter's value.
|
|
61
|
-
*
|
|
62
|
-
* @param target The {@link object } hosting the tagged method as provided by the runtime.
|
|
63
|
-
* @param propertyKey The tagged method's name as provided by the runtime.
|
|
64
|
-
* @param descriptor The {@link PropertyDescriptor } as provided by the runtime.
|
|
65
|
-
*
|
|
66
|
-
* @returns The {@link PropertyDescriptor } that was passed by the runtime. */
|
|
67
|
-
static ParamvalueProvider(target, propertyKey, descriptor) {
|
|
68
|
-
const originalMethod = descriptor.value;
|
|
69
|
-
// biome-ignore lint/suspicious/noExplicitAny: Gotta be any since parameter-values may be undefined.
|
|
70
|
-
descriptor.value = (...args) => {
|
|
71
|
-
// #region Check if a value of one of the method's parameter has been requested and pass it to the
|
|
72
|
-
// receptor, if so.
|
|
73
|
-
if (DBC.paramValueRequests.has(target) &&
|
|
74
|
-
DBC.paramValueRequests.get(target).has(propertyKey)) {
|
|
75
|
-
for (const index of DBC.paramValueRequests
|
|
76
|
-
.get(target)
|
|
77
|
-
.get(propertyKey)
|
|
78
|
-
.keys()) {
|
|
79
|
-
if (index < args.length) {
|
|
80
|
-
for (const receptor of DBC.paramValueRequests
|
|
81
|
-
.get(target)
|
|
82
|
-
.get(propertyKey)
|
|
83
|
-
.get(index)) {
|
|
84
|
-
receptor(args[index]);
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
// #endregion Check if a value of one of the method's parameter has been requested and pass it to the
|
|
90
|
-
// receptor, if so.
|
|
91
|
-
// biome-ignore lint/complexity/noThisInStatic: Necessary.
|
|
92
|
-
return originalMethod.apply(this, args);
|
|
93
|
-
};
|
|
94
|
-
return descriptor;
|
|
95
|
-
}
|
|
96
|
-
// #endregion Parameter-value requests.
|
|
97
|
-
// #region Invariant
|
|
98
|
-
/**
|
|
99
|
-
* A property-decorator factory serving as a **D**esign **B**y **C**ontract Invariant.
|
|
100
|
-
* Since the value must be initialized or set according to the specified **contracts** the value will only be checked
|
|
101
|
-
* when assigning it.
|
|
102
|
-
*
|
|
103
|
-
* @param contracts The {@link DBC }-Contracts the value shall uphold.
|
|
104
|
-
*
|
|
105
|
-
* @throws A {@link DBC.Infringement } whenever the property is tried to be set to a value that does not comply to the
|
|
106
|
-
* specified **contracts**, by the returned method.*/
|
|
107
|
-
static decInvariant(contracts, path = undefined, dbc = "WaXCode.DBC") {
|
|
108
|
-
return (target, propertyKey) => {
|
|
109
|
-
// biome-ignore lint/suspicious/noExplicitAny: Necessary to intercept UNDEFINED and NULL.
|
|
110
|
-
let value;
|
|
111
|
-
// #region Replace original property.
|
|
112
|
-
Object.defineProperty(target, propertyKey, {
|
|
113
|
-
set(newValue) {
|
|
114
|
-
const realValue = path ? DBC.resolve(newValue, path) : newValue;
|
|
115
|
-
// #region Check if all "contracts" are fulfilled.
|
|
116
|
-
for (const contract of contracts) {
|
|
117
|
-
const result = contract.check(realValue);
|
|
118
|
-
if (typeof result === "string") {
|
|
119
|
-
DBC.resolveDBCPath(window, dbc).reportFieldInfringement(result, target, path, propertyKey, realValue);
|
|
120
|
-
}
|
|
121
|
-
}
|
|
122
|
-
// #endregion Check if all "contracts" are fulfilled.
|
|
123
|
-
value = newValue;
|
|
124
|
-
},
|
|
125
|
-
enumerable: true,
|
|
126
|
-
configurable: true,
|
|
127
|
-
});
|
|
128
|
-
// #endregion Replace original property.
|
|
129
|
-
};
|
|
130
|
-
}
|
|
131
|
-
// #endregion Invariant
|
|
132
|
-
// #region Postcondition
|
|
133
|
-
/**
|
|
134
|
-
* A method decorator factory checking the result of a method whenever it is invoked thus also usable on getters.
|
|
135
|
-
*
|
|
136
|
-
* @param check The **(toCheck: any, object, string) => boolean | string** to use for checking.
|
|
137
|
-
* @param dbc See {@link DBC.resolveDBCPath }.
|
|
138
|
-
* @param path The dotted path referring to the actual value to check, starting form the specified one.
|
|
139
|
-
*
|
|
140
|
-
* @returns The **( target : object, propertyKey : string, descriptor : PropertyDescriptor ) : PropertyDescriptor**
|
|
141
|
-
* invoked by Typescript.
|
|
142
|
-
*/
|
|
143
|
-
static decPostcondition(
|
|
144
|
-
// biome-ignore lint/suspicious/noExplicitAny: Necessary to intercept UNDEFINED and NULL.
|
|
145
|
-
check, dbc, path = undefined) {
|
|
146
|
-
return (target, propertyKey, descriptor) => {
|
|
147
|
-
const originalMethod = descriptor.value;
|
|
148
|
-
// biome-ignore lint/suspicious/noExplicitAny: Necessary to intercept UNDEFINED and NULL.
|
|
149
|
-
descriptor.value = (...args) => {
|
|
150
|
-
// biome-ignore lint/complexity/noThisInStatic: <explanation>
|
|
151
|
-
const result = originalMethod.apply(this, args);
|
|
152
|
-
const realValue = path ? DBC.resolve(result, path) : result;
|
|
153
|
-
const checkResult = check(realValue, target, propertyKey);
|
|
154
|
-
if (typeof checkResult === "string") {
|
|
155
|
-
DBC.resolveDBCPath(window, dbc).reportReturnvalueInfringement(checkResult, target, path, propertyKey, realValue);
|
|
156
|
-
}
|
|
157
|
-
return result;
|
|
158
|
-
};
|
|
159
|
-
return descriptor;
|
|
160
|
-
};
|
|
161
|
-
}
|
|
162
|
-
// #endregion Postcondition
|
|
163
|
-
// #region Decorator
|
|
164
|
-
// #region Precondition
|
|
165
|
-
/**
|
|
166
|
-
* A parameter-decorator factory that requests the tagged parameter's value passing it to the provided
|
|
167
|
-
* "check"-method when the value becomes available.
|
|
168
|
-
*
|
|
169
|
-
* @param check The "( unknown ) => void" to be invoked along with the tagged parameter's value as soon
|
|
170
|
-
* as it becomes available.
|
|
171
|
-
* @param dbc See {@link DBC.resolveDBCPath }.
|
|
172
|
-
* @param path The dotted path referring to the actual value to check, starting form the specified one.
|
|
173
|
-
*
|
|
174
|
-
* @returns The **(target: object, methodName: string | symbol, parameterIndex: number ) => void** invoked by Typescript- */
|
|
175
|
-
static decPrecondition(check, dbc, path = undefined) {
|
|
176
|
-
return (target, methodName, parameterIndex) => {
|
|
177
|
-
DBC.requestParamValue(target, methodName, parameterIndex, (value) => {
|
|
178
|
-
const realValue = path ? DBC.resolve(value, path) : value;
|
|
179
|
-
const result = check(realValue, target, methodName, parameterIndex);
|
|
180
|
-
if (typeof result === "string") {
|
|
181
|
-
DBC.resolveDBCPath(window, dbc).reportParameterInfringement(result, target, path, methodName, parameterIndex, realValue);
|
|
182
|
-
}
|
|
183
|
-
});
|
|
184
|
-
};
|
|
185
|
-
}
|
|
186
|
-
/**
|
|
187
|
-
* Reports a warning.
|
|
188
|
-
*
|
|
189
|
-
* @param message The message containing the warning. */
|
|
190
|
-
reportWarning(message) {
|
|
191
|
-
if (this.warningSettings.logToConsole) {
|
|
192
|
-
console.warn(message);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Reports an infringement according to the {@link infringementSettings } also generating a proper {@link string }-wrapper
|
|
197
|
-
* for the given "message" & violator.
|
|
198
|
-
*
|
|
199
|
-
* @param message The {@link string } describing the infringement and it's provenience.
|
|
200
|
-
* @param violator The {@link string } describing or naming the violator. */
|
|
201
|
-
reportInfringement(message, violator, target, path) {
|
|
202
|
-
const finalMessage = `[ From "${violator}"${path ? `'s member "${path}"` : ""}${typeof target === "function" ? ` in "${target.name}"` : typeof target === "object" && target !== null && typeof target.constructor === "function" ? ` in "${target.constructor.name}"` : ""}: ${message}]`;
|
|
203
|
-
if (this.infringementSettings.throwException) {
|
|
204
|
-
throw new DBC.Infringement(finalMessage);
|
|
205
|
-
}
|
|
206
|
-
if (this.infringementSettings.logToConsole) {
|
|
207
|
-
console.log(finalMessage);
|
|
208
|
-
}
|
|
209
|
-
}
|
|
210
|
-
/**
|
|
211
|
-
* Reports a parameter-infringement via {@link reportInfringement } also generating a proper {@link string }-wrapper
|
|
212
|
-
* for the given "message","method", parameter-"index" & value.
|
|
213
|
-
*
|
|
214
|
-
* @param message The {@link string } describing the infringement and it's provenience.
|
|
215
|
-
* @param method The {@link string } describing or naming the violator.
|
|
216
|
-
* @param index The index of the parameter within the argument listing.
|
|
217
|
-
* @param value The parameter's value. */
|
|
218
|
-
reportParameterInfringement(message, target, path, method, index, value) {
|
|
219
|
-
const properIndex = index + 1;
|
|
220
|
-
this.reportInfringement(`[ Parameter-value "${value}" of the ${properIndex}${properIndex === 1 ? "st" : properIndex === 2 ? "nd" : properIndex === 3 ? "rd" : "th"} parameter did not fulfill one of it's contracts: ${message}]`, method, target, path);
|
|
221
|
-
}
|
|
222
|
-
/**
|
|
223
|
-
* Reports a field-infringement via {@link reportInfringement } also generating a proper {@link string }-wrapper
|
|
224
|
-
* for the given **message** & **name**.
|
|
225
|
-
*
|
|
226
|
-
* @param message A {@link string } describing the infringement and it's provenience.
|
|
227
|
-
* @param key The property key.
|
|
228
|
-
* @param path The dotted-path {@link string } that leads to the value not fulfilling the contract starting from
|
|
229
|
-
* the tagged one.
|
|
230
|
-
* @param value The value not fulfilling a contract. */
|
|
231
|
-
reportFieldInfringement(message, target, path, key, value) {
|
|
232
|
-
this.reportInfringement(`[ New value for "${key}"${path === undefined ? "" : `.${path}`} with value "${value}" did not fulfill one of it's contracts: ${message}]`, key, target, path);
|
|
233
|
-
}
|
|
234
|
-
/**
|
|
235
|
-
* Reports a returnvalue-infringement according via {@link reportInfringement } also generating a proper {@link string }-wrapper
|
|
236
|
-
* for the given "message","method" & value.
|
|
237
|
-
*
|
|
238
|
-
* @param message The {@link string } describing the infringement and it's provenience.
|
|
239
|
-
* @param method The {@link string } describing or naming the violator.
|
|
240
|
-
* @param value The parameter's value. */
|
|
241
|
-
reportReturnvalueInfringement(message, target, path, method,
|
|
242
|
-
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
243
|
-
value) {
|
|
244
|
-
this.reportInfringement(`[ Return-value "${value}" did not fulfill one of it's contracts: ${message}]`, method, target, path);
|
|
245
|
-
}
|
|
246
|
-
/**
|
|
247
|
-
* Constructs this {@link DBC } by setting the {@link DBC.infringementSettings }, define the **WaXCode** namespace in
|
|
248
|
-
* **window** if not yet available and setting the property **DBC** in there to the instance of this {@link DBC }.
|
|
249
|
-
*
|
|
250
|
-
* @param infringementSettings See {@link DBC.infringementSettings }. */
|
|
251
|
-
constructor(infringementSettings = { throwException: true, logToConsole: false }) {
|
|
252
|
-
// #endregion Precondition
|
|
253
|
-
// #endregion Decorator
|
|
254
|
-
// #region Warning handling.
|
|
255
|
-
/** Stores settings concerning warnings. */
|
|
256
|
-
this.warningSettings = { logToConsole: true };
|
|
257
|
-
// #endregion Warning handling.
|
|
258
|
-
// #region infringement handling.
|
|
259
|
-
/** Stores the settings concerning infringements */
|
|
260
|
-
this.infringementSettings = { throwException: true, logToConsole: false };
|
|
261
|
-
this.infringementSettings = infringementSettings;
|
|
262
|
-
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
263
|
-
if (window.WaXCode === undefined)
|
|
264
|
-
window.WaXCode = {};
|
|
265
|
-
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
266
|
-
window.WaXCode.DBC = this;
|
|
267
|
-
}
|
|
268
|
-
/**
|
|
269
|
-
* Resolves the desired {@link object } out a given one **toResolveFrom** using the specified **path**.
|
|
270
|
-
*
|
|
271
|
-
* @param toResolveFrom The {@link object } starting to resolve from.
|
|
272
|
-
* @param path The dotted path-{@link string }.
|
|
273
|
-
* This string uses ., [...], and () to represent accessing nested properties,
|
|
274
|
-
* array elements/object keys, and calling methods, respectively, mimicking JavaScript syntax to navigate
|
|
275
|
-
* an object's structure. Code, e.g. something like a.b( 1 as number ).c, will not be executed and
|
|
276
|
-
* thus make the retrieval fail.
|
|
277
|
-
*
|
|
278
|
-
* @returns The requested {@link object }, NULL or UNDEFINED. */
|
|
279
|
-
static resolve(toResolveFrom, path) {
|
|
280
|
-
if (!toResolveFrom || typeof path !== "string") {
|
|
281
|
-
return undefined;
|
|
282
|
-
}
|
|
283
|
-
const parts = path.replace(/\[(['"]?)(.*?)\1\]/g, ".$2").split("."); // Handle indexers
|
|
284
|
-
let current = toResolveFrom;
|
|
285
|
-
for (const part of parts) {
|
|
286
|
-
if (current === null || typeof current === "undefined") {
|
|
287
|
-
return undefined;
|
|
288
|
-
}
|
|
289
|
-
const methodMatch = part.match(/(\w+)\((.*)\)/);
|
|
290
|
-
if (methodMatch) {
|
|
291
|
-
const methodName = methodMatch[1];
|
|
292
|
-
const argsStr = methodMatch[2];
|
|
293
|
-
const args = argsStr.split(",").map((arg) => arg.trim()); // Simple argument parsing
|
|
294
|
-
if (typeof current[methodName] === "function") {
|
|
295
|
-
current = current[methodName].apply(current, args);
|
|
296
|
-
}
|
|
297
|
-
else {
|
|
298
|
-
return undefined; // Method not found or not a function
|
|
299
|
-
}
|
|
300
|
-
}
|
|
301
|
-
else {
|
|
302
|
-
current = current[part];
|
|
303
|
-
}
|
|
304
|
-
}
|
|
305
|
-
return current;
|
|
306
|
-
}
|
|
307
|
-
}
|
|
308
|
-
// #region Parameter-value requests.
|
|
309
|
-
/** Stores all request for parameter values registered by {@link decPrecondition }. */
|
|
310
|
-
DBC.paramValueRequests = new Map();
|
|
311
|
-
// #region Classes
|
|
312
|
-
// #region Errors
|
|
313
|
-
/** An {@link Error } to be thrown whenever an infringement is detected. */
|
|
314
|
-
DBC.Infringement = class extends Error {
|
|
315
|
-
/**
|
|
316
|
-
* Constructs this {@link Error } by tagging the specified message-{@link string } as an XDBC-Infringement.
|
|
317
|
-
*
|
|
318
|
-
* @param message The {@link string } describing the infringement. */
|
|
319
|
-
constructor(message) {
|
|
320
|
-
super(`[ XDBC Infringement ${message}]`);
|
|
321
|
-
}
|
|
322
|
-
};
|
|
323
|
-
// #endregion Errors
|
|
324
|
-
// #endregion Classes
|
|
325
|
-
// #endregion infringement handling.
|
|
326
|
-
/**
|
|
327
|
-
* Resolves the specified dotted {@link string }-path to a {@link DBC }.
|
|
328
|
-
*
|
|
329
|
-
* @param obj The {@link object } to start resolving from.
|
|
330
|
-
* @param path The dotted {@link string }-path leading to the {@link DBC }.
|
|
331
|
-
*
|
|
332
|
-
* @returns The requested {@link DBC }.
|
|
333
|
-
*/
|
|
334
|
-
DBC.resolveDBCPath = (obj, path) => path === null || path === void 0 ? void 0 : path.split(".").reduce((accumulator, current) => accumulator[current], obj);
|
|
335
|
-
// Set the main instance with standard **DBC.infringementSettings**.
|
|
336
|
-
new DBC();
|
package/dist/Demo.js
DELETED
|
@@ -1,290 +0,0 @@
|
|
|
1
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
2
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
3
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
4
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
5
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
6
|
-
};
|
|
7
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
8
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
9
|
-
};
|
|
10
|
-
var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
11
|
-
return function (target, key) { decorator(target, key, paramIndex); }
|
|
12
|
-
};
|
|
13
|
-
import { DBC } from "./DBC";
|
|
14
|
-
import { REGEX } from "./DBC/REGEX";
|
|
15
|
-
import { EQ } from "./DBC/EQ";
|
|
16
|
-
import { TYPE } from "./DBC/TYPE";
|
|
17
|
-
import { AE } from "./DBC/AE";
|
|
18
|
-
import { INSTANCE } from "./DBC/INSTANCE";
|
|
19
|
-
import { GREATER } from "./DBC/COMPARISON/GREATER";
|
|
20
|
-
/** Demonstrative use of **D**esign **B**y **C**ontract Decorators */
|
|
21
|
-
export class Demo {
|
|
22
|
-
constructor() {
|
|
23
|
-
// #region Check Property Decorator
|
|
24
|
-
this.testProperty = "a";
|
|
25
|
-
// #endregion Check Comparison
|
|
26
|
-
}
|
|
27
|
-
// #endregion Check Property Decorator
|
|
28
|
-
// #region Check Parameter. & Returnvalue Decorator
|
|
29
|
-
testParamvalueAndReturnvalue(a) {
|
|
30
|
-
return `xxxx${a}`;
|
|
31
|
-
}
|
|
32
|
-
// #endregion Check Parameter. & Returnvalue Decorator
|
|
33
|
-
// #region Check Returnvalue Decorator
|
|
34
|
-
testReturnvalue(a) {
|
|
35
|
-
return a;
|
|
36
|
-
}
|
|
37
|
-
// #endregion Check Returnvalue Decorator
|
|
38
|
-
// #region Check EQ-DBC & Path to property of Parameter-value
|
|
39
|
-
testEQAndPath(o) { }
|
|
40
|
-
// #endregion Check EQ-DBC & Path to property of Parameter-value
|
|
41
|
-
// #region Check EQ-DBC & Path to property of Parameter-value with Inversion
|
|
42
|
-
testEQAndPathWithInversion(o) { }
|
|
43
|
-
// #endregion Check EQ-DBC & Path to property of Parameter-value with Inversion
|
|
44
|
-
// #region Check TYPE
|
|
45
|
-
testTYPE(o) { }
|
|
46
|
-
// #endregion Check TYPE
|
|
47
|
-
// #region Check AE
|
|
48
|
-
testAE(x) { }
|
|
49
|
-
// #endregion Check AE
|
|
50
|
-
// #region Check REGEX with AE
|
|
51
|
-
testREGEXWithAE(x) { }
|
|
52
|
-
// #endregion Check REGEX with AE
|
|
53
|
-
// #region Check INSTANCE
|
|
54
|
-
testINSTANCE(candidate) { }
|
|
55
|
-
// #endregion Check INSTANCE
|
|
56
|
-
// #region Check AE Range
|
|
57
|
-
testAERange(x) { }
|
|
58
|
-
// #endregion Check AE Range
|
|
59
|
-
// #region Check AE Index
|
|
60
|
-
testAEIndex(x) { }
|
|
61
|
-
// #endregion Check AE Index
|
|
62
|
-
// #region Check Comparison
|
|
63
|
-
testGREATER(input) { }
|
|
64
|
-
}
|
|
65
|
-
__decorate([
|
|
66
|
-
REGEX.INVARIANT(/^a$/),
|
|
67
|
-
__metadata("design:type", Object)
|
|
68
|
-
], Demo.prototype, "testProperty", void 0);
|
|
69
|
-
__decorate([
|
|
70
|
-
REGEX.POST(/^xxxx.*$/),
|
|
71
|
-
DBC.ParamvalueProvider,
|
|
72
|
-
__param(0, REGEX.PRE(/holla*/g)),
|
|
73
|
-
__metadata("design:type", Function),
|
|
74
|
-
__metadata("design:paramtypes", [String]),
|
|
75
|
-
__metadata("design:returntype", String)
|
|
76
|
-
], Demo.prototype, "testParamvalueAndReturnvalue", null);
|
|
77
|
-
__decorate([
|
|
78
|
-
REGEX.POST(/^xxxx.*$/),
|
|
79
|
-
__metadata("design:type", Function),
|
|
80
|
-
__metadata("design:paramtypes", [String]),
|
|
81
|
-
__metadata("design:returntype", String)
|
|
82
|
-
], Demo.prototype, "testReturnvalue", null);
|
|
83
|
-
__decorate([
|
|
84
|
-
DBC.ParamvalueProvider,
|
|
85
|
-
__param(0, EQ.PRE("SELECT", false, "tagName")),
|
|
86
|
-
__metadata("design:type", Function),
|
|
87
|
-
__metadata("design:paramtypes", [HTMLElement]),
|
|
88
|
-
__metadata("design:returntype", void 0)
|
|
89
|
-
], Demo.prototype, "testEQAndPath", null);
|
|
90
|
-
__decorate([
|
|
91
|
-
DBC.ParamvalueProvider,
|
|
92
|
-
__param(0, EQ.PRE("SELECT", true, "tagName")),
|
|
93
|
-
__metadata("design:type", Function),
|
|
94
|
-
__metadata("design:paramtypes", [HTMLElement]),
|
|
95
|
-
__metadata("design:returntype", void 0)
|
|
96
|
-
], Demo.prototype, "testEQAndPathWithInversion", null);
|
|
97
|
-
__decorate([
|
|
98
|
-
DBC.ParamvalueProvider,
|
|
99
|
-
__param(0, TYPE.PRE("string")),
|
|
100
|
-
__metadata("design:type", Function),
|
|
101
|
-
__metadata("design:paramtypes", [Object]),
|
|
102
|
-
__metadata("design:returntype", void 0)
|
|
103
|
-
], Demo.prototype, "testTYPE", null);
|
|
104
|
-
__decorate([
|
|
105
|
-
DBC.ParamvalueProvider,
|
|
106
|
-
__param(0, AE.PRE([new TYPE("string")])),
|
|
107
|
-
__metadata("design:type", Function),
|
|
108
|
-
__metadata("design:paramtypes", [Array]),
|
|
109
|
-
__metadata("design:returntype", void 0)
|
|
110
|
-
], Demo.prototype, "testAE", null);
|
|
111
|
-
__decorate([
|
|
112
|
-
DBC.ParamvalueProvider,
|
|
113
|
-
__param(0, AE.PRE(new REGEX(/^(?i:(NOW)|([+-]\d+[dmy]))$/i))),
|
|
114
|
-
__metadata("design:type", Function),
|
|
115
|
-
__metadata("design:paramtypes", [Array]),
|
|
116
|
-
__metadata("design:returntype", void 0)
|
|
117
|
-
], Demo.prototype, "testREGEXWithAE", null);
|
|
118
|
-
__decorate([
|
|
119
|
-
DBC.ParamvalueProvider
|
|
120
|
-
// biome-ignore lint/suspicious/noExplicitAny: Test
|
|
121
|
-
,
|
|
122
|
-
__param(0, INSTANCE.PRE(Date)),
|
|
123
|
-
__metadata("design:type", Function),
|
|
124
|
-
__metadata("design:paramtypes", [Object]),
|
|
125
|
-
__metadata("design:returntype", void 0)
|
|
126
|
-
], Demo.prototype, "testINSTANCE", null);
|
|
127
|
-
__decorate([
|
|
128
|
-
DBC.ParamvalueProvider,
|
|
129
|
-
__param(0, AE.PRE([new TYPE("string"), new REGEX(/^abc$/)], 1, 2)),
|
|
130
|
-
__metadata("design:type", Function),
|
|
131
|
-
__metadata("design:paramtypes", [Array]),
|
|
132
|
-
__metadata("design:returntype", void 0)
|
|
133
|
-
], Demo.prototype, "testAERange", null);
|
|
134
|
-
__decorate([
|
|
135
|
-
DBC.ParamvalueProvider,
|
|
136
|
-
__param(0, AE.PRE([new TYPE("string"), new REGEX(/^abc$/)], 1)),
|
|
137
|
-
__metadata("design:type", Function),
|
|
138
|
-
__metadata("design:paramtypes", [Array]),
|
|
139
|
-
__metadata("design:returntype", void 0)
|
|
140
|
-
], Demo.prototype, "testAEIndex", null);
|
|
141
|
-
__decorate([
|
|
142
|
-
__param(0, GREATER.PRE(2)),
|
|
143
|
-
__metadata("design:type", Function),
|
|
144
|
-
__metadata("design:paramtypes", [Number]),
|
|
145
|
-
__metadata("design:returntype", void 0)
|
|
146
|
-
], Demo.prototype, "testGREATER", null);
|
|
147
|
-
const demo = new Demo();
|
|
148
|
-
try {
|
|
149
|
-
demo.testProperty = "abd";
|
|
150
|
-
}
|
|
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
|
-
}
|
|
168
|
-
catch (X) {
|
|
169
|
-
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
170
|
-
console.log("PARAMETER- & RETURNVALUE Infringement", "OK");
|
|
171
|
-
console.log(X);
|
|
172
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
173
|
-
}
|
|
174
|
-
demo.testReturnvalue("xxxx");
|
|
175
|
-
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
176
|
-
console.log("RETURNVALUE OK");
|
|
177
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
178
|
-
try {
|
|
179
|
-
demo.testReturnvalue("yyyy");
|
|
180
|
-
}
|
|
181
|
-
catch (X) {
|
|
182
|
-
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
183
|
-
console.log("RETURNVALUE Infringement", "OK");
|
|
184
|
-
console.log(X);
|
|
185
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
186
|
-
}
|
|
187
|
-
demo.testEQAndPath(document.createElement("select"));
|
|
188
|
-
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
189
|
-
console.log("EQ with Path Infringement OK");
|
|
190
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
191
|
-
try {
|
|
192
|
-
demo.testEQAndPathWithInversion(document.createElement("select"));
|
|
193
|
-
}
|
|
194
|
-
catch (X) {
|
|
195
|
-
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
196
|
-
console.log("EQ with Path and Inversion Infringement OK");
|
|
197
|
-
console.log(X);
|
|
198
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
199
|
-
}
|
|
200
|
-
demo.testTYPE("x");
|
|
201
|
-
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
202
|
-
console.log("TYPE OK");
|
|
203
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
204
|
-
try {
|
|
205
|
-
demo.testTYPE(0);
|
|
206
|
-
}
|
|
207
|
-
catch (X) {
|
|
208
|
-
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
209
|
-
console.log("TYPE Infringement OK");
|
|
210
|
-
console.log(X);
|
|
211
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
212
|
-
}
|
|
213
|
-
demo.testAE(["11", "10", "b"]);
|
|
214
|
-
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
215
|
-
console.log("AE OK");
|
|
216
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
217
|
-
try {
|
|
218
|
-
demo.testAE(["11", 11, "b"]);
|
|
219
|
-
}
|
|
220
|
-
catch (X) {
|
|
221
|
-
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
222
|
-
console.log("AE Infringement OK");
|
|
223
|
-
console.log(X);
|
|
224
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
225
|
-
}
|
|
226
|
-
demo.testREGEXWithAE(["+1d", "NOW", "-10y"]);
|
|
227
|
-
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
228
|
-
console.log("REGEX with AE OK");
|
|
229
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
230
|
-
try {
|
|
231
|
-
demo.testREGEXWithAE(["+1d", "+5d", "-x10y"]);
|
|
232
|
-
}
|
|
233
|
-
catch (X) {
|
|
234
|
-
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
235
|
-
console.log("REGEX with AE Infringement OK");
|
|
236
|
-
console.log(X);
|
|
237
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
238
|
-
}
|
|
239
|
-
demo.testINSTANCE(new Date());
|
|
240
|
-
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
241
|
-
console.log("INSTANCE OK");
|
|
242
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
243
|
-
try {
|
|
244
|
-
demo.testINSTANCE(demo);
|
|
245
|
-
}
|
|
246
|
-
catch (X) {
|
|
247
|
-
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
248
|
-
console.log("INSTANCE Infringement OK");
|
|
249
|
-
console.log(X);
|
|
250
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
251
|
-
}
|
|
252
|
-
demo.testAERange([11, "abc", "abc"]);
|
|
253
|
-
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
254
|
-
console.log("AE Range OK");
|
|
255
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
256
|
-
try {
|
|
257
|
-
demo.testAERange([11, "abc", /a/g]);
|
|
258
|
-
}
|
|
259
|
-
catch (X) {
|
|
260
|
-
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
261
|
-
console.log("AE Range Infringement OK");
|
|
262
|
-
console.log(X);
|
|
263
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
264
|
-
}
|
|
265
|
-
demo.testAEIndex([11, "abc", "abc"]);
|
|
266
|
-
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
267
|
-
console.log("AE Index OK");
|
|
268
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
269
|
-
try {
|
|
270
|
-
demo.testAEIndex(["11", 12, "/a/g"]);
|
|
271
|
-
}
|
|
272
|
-
catch (X) {
|
|
273
|
-
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
274
|
-
console.log("AE Index Infringement OK");
|
|
275
|
-
console.log(X);
|
|
276
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
277
|
-
}
|
|
278
|
-
demo.testGREATER(11);
|
|
279
|
-
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
280
|
-
console.log("GREATER OK");
|
|
281
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
282
|
-
try {
|
|
283
|
-
demo.testGREATER(2);
|
|
284
|
-
}
|
|
285
|
-
catch (X) {
|
|
286
|
-
console.log("⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄⌄");
|
|
287
|
-
console.log("GREATER OK");
|
|
288
|
-
console.log(X);
|
|
289
|
-
console.log("^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^");
|
|
290
|
-
}
|
package/dist/Test.html
DELETED
|
@@ -1,18 +0,0 @@
|
|
|
1
|
-
<!DOCTYPE html>
|
|
2
|
-
<html lang="en">
|
|
3
|
-
<head>
|
|
4
|
-
<meta charset="UTF-8">
|
|
5
|
-
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
6
|
-
<title>Load test.js</title>
|
|
7
|
-
</head>
|
|
8
|
-
<body>
|
|
9
|
-
<h1>Loading test.js Script</h1>
|
|
10
|
-
|
|
11
|
-
<script src="dist/bundle.js" type="module"></script>
|
|
12
|
-
<script>
|
|
13
|
-
|
|
14
|
-
</script>
|
|
15
|
-
|
|
16
|
-
<p>Check the browser's developer console (usually opened with F12) for output.</p>
|
|
17
|
-
</body>
|
|
18
|
-
</html>
|