xdbc 1.0.125 → 1.0.127
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/dist/DBC/INSTANCE.js +3 -2
- package/dist/DBC/TYPE.js +3 -2
- package/package.json +2 -2
- package/src/DBC/AE.ts +2 -2
- package/src/DBC/COMPARISON/GREATER.ts +2 -2
- package/src/DBC/INSTANCE.ts +5 -4
- package/src/DBC/TYPE.ts +5 -4
- package/tsconfig.json +3 -1
package/dist/DBC/INSTANCE.js
CHANGED
|
@@ -87,17 +87,18 @@ export class INSTANCE extends DBC {
|
|
|
87
87
|
* @param toCheck See {@link INSTANCE.checkAlgorithm }.
|
|
88
88
|
* @param reference See {@link INSTANCE.checkAlgorithm }.
|
|
89
89
|
* @param id A {@link string } identifying this {@link INSTANCE } via the {@link DBC.Infringement }-Message.
|
|
90
|
+
* @param hint An optional {@link string } providing extra information in case of an infringement.
|
|
90
91
|
*
|
|
91
92
|
* @returns The **CANDIDATE** **toCheck** doesn't fulfill this {@link INSTANCE }.
|
|
92
93
|
*
|
|
93
94
|
* @throws A {@link DBC.Infringement } if the **CANDIDATE** **toCheck** does not fulfill this {@link DEFINED }. */
|
|
94
|
-
static tsCheck(toCheck, reference, id = undefined) {
|
|
95
|
+
static tsCheck(toCheck, reference, id = undefined, hint = undefined) {
|
|
95
96
|
const result = INSTANCE.checkAlgorithm(toCheck, reference);
|
|
96
97
|
if (result === true) {
|
|
97
98
|
return toCheck;
|
|
98
99
|
}
|
|
99
100
|
else {
|
|
100
|
-
throw new DBC.Infringement(`${id ? `(${id}) ` : ""}${result}`);
|
|
101
|
+
throw new DBC.Infringement(`${id ? `(${id}) ` : ""}${result} ${hint ? `< ${hint} >` : ""}`);
|
|
101
102
|
}
|
|
102
103
|
}
|
|
103
104
|
/**
|
package/dist/DBC/TYPE.js
CHANGED
|
@@ -82,17 +82,18 @@ export class TYPE extends DBC {
|
|
|
82
82
|
* @param toCheck See {@link INSTANCE.checkAlgorithm }.
|
|
83
83
|
* @param type See {@link INSTANCE.checkAlgorithm }.
|
|
84
84
|
* @param id A {@link string } identifying this {@link TYPE } via the {@link DBC.Infringement }-Message.
|
|
85
|
+
* @param hint An optional {@link string } providing extra information in case of an infringement.
|
|
85
86
|
*
|
|
86
87
|
* @returns The **CANDIDATE** **toCheck** doesn't fulfill this {@link TYPE }.
|
|
87
88
|
*
|
|
88
89
|
* @throws A {@link DBC.Infringement } if the **CANDIDATE** **toCheck** does not fulfill this {@link DEFINED }. */
|
|
89
|
-
static tsCheck(toCheck, type, id = undefined) {
|
|
90
|
+
static tsCheck(toCheck, type, id = undefined, hint = undefined) {
|
|
90
91
|
const result = TYPE.checkAlgorithm(toCheck, type);
|
|
91
92
|
if (result === true) {
|
|
92
93
|
return toCheck;
|
|
93
94
|
}
|
|
94
95
|
else {
|
|
95
|
-
throw new DBC.Infringement(`${id ? `(${id}) ` : ""}${result}`);
|
|
96
|
+
throw new DBC.Infringement(`${id ? `(${id}) ` : ""}${result}${hint ? ` < ${hint} >` : ""}`);
|
|
96
97
|
}
|
|
97
98
|
}
|
|
98
99
|
/**
|
package/package.json
CHANGED
package/src/DBC/AE.ts
CHANGED
|
@@ -259,9 +259,9 @@ export class AE extends DBC {
|
|
|
259
259
|
public constructor(
|
|
260
260
|
protected conditions:
|
|
261
261
|
| Array<{
|
|
262
|
-
check: (toCheck:
|
|
262
|
+
check: (toCheck: object | undefined | null) => boolean | string;
|
|
263
263
|
}>
|
|
264
|
-
| { check: (toCheck:
|
|
264
|
+
| { check: (toCheck: object | undefined | null) => boolean | string },
|
|
265
265
|
protected index: number | undefined = undefined,
|
|
266
266
|
protected idxEnd: number | undefined = undefined,
|
|
267
267
|
) {
|
|
@@ -22,7 +22,7 @@ export class GREATER extends COMPARISON {
|
|
|
22
22
|
return COMPARISON.POST(equivalent, false, false, path, dbc);
|
|
23
23
|
}
|
|
24
24
|
/** See {@link COMPARISON.INVARIANT }. */
|
|
25
|
-
public static INVARIANT(
|
|
25
|
+
public static override INVARIANT(
|
|
26
26
|
equivalent,
|
|
27
27
|
equalityPermitted = false,
|
|
28
28
|
invert = false,
|
|
@@ -32,7 +32,7 @@ export class GREATER extends COMPARISON {
|
|
|
32
32
|
return COMPARISON.INVARIANT(equivalent, false, false, path, dbc);
|
|
33
33
|
}
|
|
34
34
|
/** See {@link COMPARISON.constructor }. */
|
|
35
|
-
constructor(public equivalent) {
|
|
35
|
+
constructor(public override equivalent) {
|
|
36
36
|
super(equivalent, false, false);
|
|
37
37
|
}
|
|
38
38
|
}
|
package/src/DBC/INSTANCE.ts
CHANGED
|
@@ -118,18 +118,19 @@ export class INSTANCE extends DBC {
|
|
|
118
118
|
* @param toCheck See {@link INSTANCE.checkAlgorithm }.
|
|
119
119
|
* @param reference See {@link INSTANCE.checkAlgorithm }.
|
|
120
120
|
* @param id A {@link string } identifying this {@link INSTANCE } via the {@link DBC.Infringement }-Message.
|
|
121
|
+
* @param hint An optional {@link string } providing extra information in case of an infringement.
|
|
121
122
|
*
|
|
122
123
|
* @returns The **CANDIDATE** **toCheck** doesn't fulfill this {@link INSTANCE }.
|
|
123
124
|
*
|
|
124
125
|
* @throws A {@link DBC.Infringement } if the **CANDIDATE** **toCheck** does not fulfill this {@link DEFINED }. */
|
|
125
|
-
public static tsCheck
|
|
126
|
+
public static tsCheck<CANDIDATE = unknown>(toCheck: any, reference: any, id: string | undefined = undefined, hint: string = undefined): CANDIDATE {
|
|
126
127
|
const result = INSTANCE.checkAlgorithm(toCheck, reference);
|
|
127
128
|
|
|
128
|
-
if(
|
|
129
|
-
return toCheck
|
|
129
|
+
if (result === true) {
|
|
130
|
+
return toCheck;
|
|
130
131
|
}
|
|
131
132
|
else {
|
|
132
|
-
throw new DBC.Infringement(
|
|
133
|
+
throw new DBC.Infringement(`${id ? `(${id}) ` : ""}${result as string} ${hint ? `< ${hint} >` : ""}`);
|
|
133
134
|
}
|
|
134
135
|
}
|
|
135
136
|
/**
|
package/src/DBC/TYPE.ts
CHANGED
|
@@ -116,18 +116,19 @@ export class TYPE extends DBC {
|
|
|
116
116
|
* @param toCheck See {@link INSTANCE.checkAlgorithm }.
|
|
117
117
|
* @param type See {@link INSTANCE.checkAlgorithm }.
|
|
118
118
|
* @param id A {@link string } identifying this {@link TYPE } via the {@link DBC.Infringement }-Message.
|
|
119
|
+
* @param hint An optional {@link string } providing extra information in case of an infringement.
|
|
119
120
|
*
|
|
120
121
|
* @returns The **CANDIDATE** **toCheck** doesn't fulfill this {@link TYPE }.
|
|
121
122
|
*
|
|
122
123
|
* @throws A {@link DBC.Infringement } if the **CANDIDATE** **toCheck** does not fulfill this {@link DEFINED }. */
|
|
123
|
-
public static tsCheck
|
|
124
|
+
public static tsCheck<CANDIDATE = unknown>(toCheck: any, type: string, id: string | undefined = undefined, hint: string = undefined): CANDIDATE {
|
|
124
125
|
const result = TYPE.checkAlgorithm(toCheck, type);
|
|
125
126
|
|
|
126
|
-
if(
|
|
127
|
-
return toCheck
|
|
127
|
+
if (result === true) {
|
|
128
|
+
return toCheck;
|
|
128
129
|
}
|
|
129
130
|
else {
|
|
130
|
-
throw new DBC.Infringement(
|
|
131
|
+
throw new DBC.Infringement(`${id ? `(${id}) ` : ""}${result as string}${hint ? ` < ${hint} >` : ""}`);
|
|
131
132
|
}
|
|
132
133
|
}
|
|
133
134
|
/**
|