xdbc 1.0.188 → 1.0.189
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/package.json +1 -1
- package/src/DBC/JSON.Parse.ts +9 -4
- package/src/DBC/OR.ts +16 -11
package/package.json
CHANGED
package/src/DBC/JSON.Parse.ts
CHANGED
|
@@ -45,7 +45,8 @@ export class JSON_Parse extends DBC {
|
|
|
45
45
|
public static PRE(
|
|
46
46
|
receptor: (json: object) => void,
|
|
47
47
|
path: string | undefined = undefined,
|
|
48
|
-
|
|
48
|
+
hint: string | undefined = undefined,
|
|
49
|
+
dbc: string | undefined = undefined,
|
|
49
50
|
): (
|
|
50
51
|
target: object,
|
|
51
52
|
methodName: string | symbol,
|
|
@@ -62,6 +63,7 @@ export class JSON_Parse extends DBC {
|
|
|
62
63
|
},
|
|
63
64
|
dbc,
|
|
64
65
|
path,
|
|
66
|
+
hint
|
|
65
67
|
);
|
|
66
68
|
}
|
|
67
69
|
/**
|
|
@@ -76,7 +78,8 @@ export class JSON_Parse extends DBC {
|
|
|
76
78
|
public static POST(
|
|
77
79
|
receptor: (json: object) => void,
|
|
78
80
|
path: string | undefined = undefined,
|
|
79
|
-
|
|
81
|
+
hint: string | undefined = undefined,
|
|
82
|
+
dbc: string | undefined = undefined,
|
|
80
83
|
): (
|
|
81
84
|
target: object,
|
|
82
85
|
propertyKey: string,
|
|
@@ -89,6 +92,7 @@ export class JSON_Parse extends DBC {
|
|
|
89
92
|
},
|
|
90
93
|
dbc,
|
|
91
94
|
path,
|
|
95
|
+
hint
|
|
92
96
|
);
|
|
93
97
|
}
|
|
94
98
|
/**
|
|
@@ -103,9 +107,10 @@ export class JSON_Parse extends DBC {
|
|
|
103
107
|
public static INVARIANT(
|
|
104
108
|
receptor: (json: object) => void,
|
|
105
109
|
path: string | undefined = undefined,
|
|
106
|
-
|
|
110
|
+
hint: string | undefined = undefined,
|
|
111
|
+
dbc: string | undefined = undefined,
|
|
107
112
|
) {
|
|
108
|
-
return DBC.decInvariant([new JSON_Parse(receptor)], path, dbc);
|
|
113
|
+
return DBC.decInvariant([new JSON_Parse(receptor)], path, dbc, hint);
|
|
109
114
|
}
|
|
110
115
|
// #endregion Condition checking.
|
|
111
116
|
// #region Referenced Condition checking.
|
package/src/DBC/OR.ts
CHANGED
|
@@ -66,7 +66,8 @@ export class OR extends DBC {
|
|
|
66
66
|
check: (toCheck: unknown | undefined | null | object) => boolean | string;
|
|
67
67
|
}>,
|
|
68
68
|
path: string | undefined = undefined,
|
|
69
|
-
|
|
69
|
+
hint: string | undefined = undefined,
|
|
70
|
+
dbc: string | undefined = undefined,
|
|
70
71
|
): (
|
|
71
72
|
target: object,
|
|
72
73
|
methodName: string | symbol,
|
|
@@ -83,6 +84,7 @@ export class OR extends DBC {
|
|
|
83
84
|
},
|
|
84
85
|
dbc,
|
|
85
86
|
path,
|
|
87
|
+
hint
|
|
86
88
|
);
|
|
87
89
|
}
|
|
88
90
|
/**
|
|
@@ -101,7 +103,8 @@ export class OR extends DBC {
|
|
|
101
103
|
check: (toCheck: unknown | undefined | null | object) => boolean | string;
|
|
102
104
|
}>,
|
|
103
105
|
path: string | undefined = undefined,
|
|
104
|
-
|
|
106
|
+
hint: string | undefined = undefined,
|
|
107
|
+
dbc: string | undefined = undefined,
|
|
105
108
|
): (
|
|
106
109
|
target: object,
|
|
107
110
|
propertyKey: string,
|
|
@@ -113,6 +116,7 @@ export class OR extends DBC {
|
|
|
113
116
|
},
|
|
114
117
|
dbc,
|
|
115
118
|
path,
|
|
119
|
+
hint
|
|
116
120
|
);
|
|
117
121
|
}
|
|
118
122
|
/**
|
|
@@ -130,9 +134,10 @@ export class OR extends DBC {
|
|
|
130
134
|
check: (toCheck: unknown | undefined | null | object) => boolean | string;
|
|
131
135
|
}>,
|
|
132
136
|
path: string | undefined = undefined,
|
|
133
|
-
|
|
137
|
+
hint: string | undefined = undefined,
|
|
138
|
+
dbc: string | undefined = undefined,
|
|
134
139
|
) {
|
|
135
|
-
return DBC.decInvariant([new OR(conditions)], path, dbc);
|
|
140
|
+
return DBC.decInvariant([new OR(conditions)], path, dbc, hint);
|
|
136
141
|
}
|
|
137
142
|
// #endregion Condition checking.
|
|
138
143
|
// #region Referenced Condition checking.
|
|
@@ -156,16 +161,16 @@ export class OR extends DBC {
|
|
|
156
161
|
* @returns The **CANDIDATE** **toCheck** doesn't fulfill this {@link OR }.
|
|
157
162
|
*
|
|
158
163
|
* @throws A {@link DBC.Infringement } if the **CANDIDATE** **toCheck** does not fulfill this {@link OR }.*/
|
|
159
|
-
public static tsCheck<CANDIDATE>(
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
const result = OR.checkAlgorithm(conditions,toCheck
|
|
164
|
+
public static tsCheck<CANDIDATE>(toCheck: unknown | undefined | null, conditions: Array<{
|
|
165
|
+
check: (toCheck: unknown | undefined | null | object) => boolean | string;
|
|
166
|
+
}>): CANDIDATE {
|
|
167
|
+
const result = OR.checkAlgorithm(conditions, toCheck);
|
|
163
168
|
|
|
164
|
-
if(
|
|
165
|
-
return toCheck as CANDIDATE
|
|
169
|
+
if (result) {
|
|
170
|
+
return toCheck as CANDIDATE;
|
|
166
171
|
}
|
|
167
172
|
else {
|
|
168
|
-
throw new DBC.Infringement(
|
|
173
|
+
throw new DBC.Infringement(result as string);
|
|
169
174
|
}
|
|
170
175
|
}
|
|
171
176
|
/**
|