xdbc 1.0.102 → 1.0.104
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/DEFINED.js +18 -1
- package/dist/DBC/INSTANCE.js +6 -3
- package/package.json +1 -1
- package/src/DBC/DEFINED.ts +8 -5
- package/src/DBC/INSTANCE.ts +9 -6
package/dist/DBC/DEFINED.js
CHANGED
|
@@ -15,7 +15,7 @@ export class DEFINED extends DBC {
|
|
|
15
15
|
static checkAlgorithm(toCheck) {
|
|
16
16
|
// biome-ignore lint/suspicious/useValidTypeof: Necessary
|
|
17
17
|
if (toCheck === undefined || toCheck === null) {
|
|
18
|
-
return `Value may not be UNDEFINED or NULL`;
|
|
18
|
+
return `Value may not be UNDEFINED or NULL but it is ${toCheck === undefined ? "UNDEFINED" : "NULL"}`;
|
|
19
19
|
}
|
|
20
20
|
return true;
|
|
21
21
|
}
|
|
@@ -74,6 +74,23 @@ export class DEFINED extends DBC {
|
|
|
74
74
|
check(toCheck) {
|
|
75
75
|
return DEFINED.checkAlgorithm(toCheck);
|
|
76
76
|
}
|
|
77
|
+
/**
|
|
78
|
+
* Invokes the {@link DEFINED.checkAlgorithm } passing the value **toCheck** and the {@link DEFINED.type } .
|
|
79
|
+
*
|
|
80
|
+
* @param toCheck See {@link DEFINED.checkAlgorithm }.
|
|
81
|
+
*
|
|
82
|
+
* @returns The **CANDIDATE** **toCheck** doesn't fulfill this {@link DEFINED }.
|
|
83
|
+
*
|
|
84
|
+
* @throws A {@link DBC.Infringement } if the **CANDIDATE** **toCheck** does not fulfill this {@link DEFINED }.*/
|
|
85
|
+
static tsCheck(toCheck) {
|
|
86
|
+
const result = DEFINED.checkAlgorithm(toCheck);
|
|
87
|
+
if (result) {
|
|
88
|
+
return toCheck;
|
|
89
|
+
}
|
|
90
|
+
else {
|
|
91
|
+
throw new DBC.Infringement(result);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
77
94
|
/** Creates this {@link DEFINED }. */
|
|
78
95
|
constructor() {
|
|
79
96
|
super();
|
package/dist/DBC/INSTANCE.js
CHANGED
|
@@ -82,10 +82,13 @@ export class INSTANCE extends DBC {
|
|
|
82
82
|
return INSTANCE.checkAlgorithm(toCheck, this.reference);
|
|
83
83
|
}
|
|
84
84
|
/**
|
|
85
|
+
* Invokes the {@link INSTANCE.checkAlgorithm } passing the value **toCheck** and the {@link INSTANCE.reference } .
|
|
86
|
+
*
|
|
87
|
+
* @param See {@link INSTANCE.checkAlgorithm }.
|
|
88
|
+
*
|
|
89
|
+
* @returns The **CANDIDATE** **toCheck** doesn't fulfill this {@link INSTANCE }.
|
|
85
90
|
*
|
|
86
|
-
* @
|
|
87
|
-
* @returns
|
|
88
|
-
*/
|
|
91
|
+
* @throws A {@link DBC.Infringement } if the **CANDIDATE** **toCheck** does not fulfill this {@link DEFINED }. */
|
|
89
92
|
tsCheck(toCheck) {
|
|
90
93
|
const result = INSTANCE.checkAlgorithm(toCheck, this.reference);
|
|
91
94
|
if (result) {
|
package/package.json
CHANGED
package/src/DBC/DEFINED.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { DBC } from "../DBC";
|
|
|
4
4
|
*
|
|
5
5
|
* @remarks
|
|
6
6
|
* Maintainer: Salvatore Callari (XDBC@WaXCode.net) */
|
|
7
|
-
export class DEFINED
|
|
7
|
+
export class DEFINED extends DBC {
|
|
8
8
|
/**
|
|
9
9
|
* Checks if the value **toCheck** is null or undefined.
|
|
10
10
|
*
|
|
@@ -108,11 +108,14 @@ export class DEFINED < CANDIDATE = any > extends DBC {
|
|
|
108
108
|
return DEFINED.checkAlgorithm(toCheck);
|
|
109
109
|
}
|
|
110
110
|
/**
|
|
111
|
+
* Invokes the {@link DEFINED.checkAlgorithm } passing the value **toCheck** and the {@link DEFINED.type } .
|
|
112
|
+
*
|
|
113
|
+
* @param toCheck See {@link DEFINED.checkAlgorithm }.
|
|
114
|
+
*
|
|
115
|
+
* @returns The **CANDIDATE** **toCheck** doesn't fulfill this {@link DEFINED }.
|
|
111
116
|
*
|
|
112
|
-
* @
|
|
113
|
-
|
|
114
|
-
*/
|
|
115
|
-
public tsCheck( toCheck : CANDIDATE | undefined | null ) : CANDIDATE {
|
|
117
|
+
* @throws A {@link DBC.Infringement } if the **CANDIDATE** **toCheck** does not fulfill this {@link DEFINED }.*/
|
|
118
|
+
public static tsCheck<CANDIDATE>( toCheck : CANDIDATE | undefined | null ) : CANDIDATE {
|
|
116
119
|
const result = DEFINED.checkAlgorithm(toCheck );
|
|
117
120
|
|
|
118
121
|
if( result ) {
|
package/src/DBC/INSTANCE.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { DBC } from "../DBC";
|
|
|
4
4
|
*
|
|
5
5
|
* @remarks
|
|
6
6
|
* Maintainer: Salvatore Callari (XDBC@WaXCode.net) */
|
|
7
|
-
export class INSTANCE
|
|
7
|
+
export class INSTANCE extends DBC {
|
|
8
8
|
/**
|
|
9
9
|
* Checks if the value **toCheck** is complies to the {@link RegExp } **expression**.
|
|
10
10
|
*
|
|
@@ -113,12 +113,15 @@ export class INSTANCE < CANDIDATE = any > extends DBC {
|
|
|
113
113
|
return INSTANCE.checkAlgorithm(toCheck, this.reference);
|
|
114
114
|
}
|
|
115
115
|
/**
|
|
116
|
+
* Invokes the {@link INSTANCE.checkAlgorithm } passing the value **toCheck** and the {@link INSTANCE.reference } .
|
|
117
|
+
*
|
|
118
|
+
* @param See {@link INSTANCE.checkAlgorithm }.
|
|
119
|
+
*
|
|
120
|
+
* @returns The **CANDIDATE** **toCheck** doesn't fulfill this {@link INSTANCE }.
|
|
116
121
|
*
|
|
117
|
-
* @
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
public tsCheck( toCheck : any ) : CANDIDATE {
|
|
121
|
-
const result = INSTANCE.checkAlgorithm(toCheck, this.reference);
|
|
122
|
+
* @throws A {@link DBC.Infringement } if the **CANDIDATE** **toCheck** does not fulfill this {@link DEFINED }. */
|
|
123
|
+
public static tsCheck < CANDIDATE > ( toCheck : any, reference : any ) : CANDIDATE {
|
|
124
|
+
const result = INSTANCE.checkAlgorithm(toCheck, reference);
|
|
122
125
|
|
|
123
126
|
if( result ) {
|
|
124
127
|
return toCheck ;
|