xdbc 1.0.73
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/.vscode/settings.json +3 -0
- package/Test.html +18 -0
- package/biome.json +33 -0
- package/dist/DBC/AE.js +163 -0
- package/dist/DBC/EQ.js +86 -0
- package/dist/DBC/INSTANCE.js +80 -0
- package/dist/DBC/JSON.OP.js +121 -0
- package/dist/DBC/JSON.Parse.js +102 -0
- package/dist/DBC/REGEX.js +103 -0
- package/dist/DBC/TYPE.js +75 -0
- package/dist/DBC.js +240 -0
- package/dist/DBC.min.js +2 -0
- package/dist/test.js +110 -0
- package/package.json +28 -0
- package/src/DBC/AE.ts +247 -0
- package/src/DBC/EQ.ts +121 -0
- package/src/DBC/INSTANCE.ts +107 -0
- package/src/DBC/JSON.OP.ts +179 -0
- package/src/DBC/JSON.Parse.ts +138 -0
- package/src/DBC/REGEX.ts +139 -0
- package/src/DBC/TYPE.ts +104 -0
- package/src/DBC.ts +355 -0
- package/src/test.ts +61 -0
- package/test.js +14 -0
- package/test.ts +11 -0
- package/tsconfig.json +15 -0
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import { DBC } from "../DBC";
|
|
2
|
+
/**
|
|
3
|
+
* A {@link DBC } demanding that a {@link string } is {@link JSON.parse}able.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Maintainer: Callari, Salvatore (XDBC@WaXCode.net) */
|
|
7
|
+
export class JSON_Parse extends DBC {
|
|
8
|
+
// #region Condition checking.
|
|
9
|
+
/**
|
|
10
|
+
* Tries to {@link JSON.parse } the {@link string } "toCheck" invoking the "receptor" with the result, if so.
|
|
11
|
+
*
|
|
12
|
+
* @param toCheck The {@link string } to be {@link JSON.parse }d.
|
|
13
|
+
* @param receptor The ( json : object ) => void to receive the {@link JSON.parse }d {@link string } "toCheck".
|
|
14
|
+
* check needs to have.
|
|
15
|
+
*
|
|
16
|
+
* @returns TRUE if the value "toCheck" is a valid JSON, otherwise a {@link string } to report the infringement. */
|
|
17
|
+
public static checkAlgorithm(
|
|
18
|
+
toCheck: string,
|
|
19
|
+
receptor: (json: object) => void,
|
|
20
|
+
): boolean | string {
|
|
21
|
+
// biome-ignore lint/suspicious/noExplicitAny: JSON.parse returns any.
|
|
22
|
+
let parsed: any;
|
|
23
|
+
|
|
24
|
+
try {
|
|
25
|
+
parsed = JSON.parse(toCheck);
|
|
26
|
+
} catch (X: unknown) {
|
|
27
|
+
return `[ Following string is not a valid JSON: ${toCheck}]`;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
if (receptor) {
|
|
31
|
+
receptor(parsed);
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
return true;
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* A parameter-decorator factory using the {@link JSON_Parse.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
38
|
+
* by the tagged parameter.
|
|
39
|
+
*
|
|
40
|
+
* @param receptor See {@link JSON.checkAlgorithm }.
|
|
41
|
+
* @param path See {@link DBC.decPrecondition }.
|
|
42
|
+
* @param dbc See {@link DBC.decPrecondition }.
|
|
43
|
+
*
|
|
44
|
+
* @returns See {@link DBC.decPrecondition }. */
|
|
45
|
+
public static PRE(
|
|
46
|
+
receptor: (json: object) => void,
|
|
47
|
+
path: string | undefined = undefined,
|
|
48
|
+
dbc = "WaXCode.DBC",
|
|
49
|
+
): (
|
|
50
|
+
target: object,
|
|
51
|
+
methodName: string | symbol,
|
|
52
|
+
parameterIndex: number,
|
|
53
|
+
) => void {
|
|
54
|
+
return DBC.decPrecondition(
|
|
55
|
+
(
|
|
56
|
+
value: string,
|
|
57
|
+
target: object,
|
|
58
|
+
methodName: string,
|
|
59
|
+
parameterIndex: number,
|
|
60
|
+
) => {
|
|
61
|
+
return JSON_Parse.checkAlgorithm(value, receptor);
|
|
62
|
+
},
|
|
63
|
+
dbc,
|
|
64
|
+
path,
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* A method-decorator factory using the {@link JSON_Parse.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
69
|
+
* by the tagged method's returnvalue.
|
|
70
|
+
*
|
|
71
|
+
* @param expression See {@link JSON.checkAlgorithm }.
|
|
72
|
+
* @param path See {@link DBC.Postcondition }.
|
|
73
|
+
* @param dbc See {@link DBC.decPostcondition }.
|
|
74
|
+
*
|
|
75
|
+
* @returns See {@link DBC.decPostcondition }. */
|
|
76
|
+
public static POST(
|
|
77
|
+
receptor: (json: object) => void,
|
|
78
|
+
path: string | undefined = undefined,
|
|
79
|
+
dbc = "WaXCode.DBC",
|
|
80
|
+
): (
|
|
81
|
+
target: object,
|
|
82
|
+
propertyKey: string,
|
|
83
|
+
descriptor: PropertyDescriptor,
|
|
84
|
+
) => PropertyDescriptor {
|
|
85
|
+
return DBC.decPostcondition(
|
|
86
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
87
|
+
(value: any, target: object, propertyKey: string) => {
|
|
88
|
+
return JSON_Parse.checkAlgorithm(value, receptor);
|
|
89
|
+
},
|
|
90
|
+
dbc,
|
|
91
|
+
path,
|
|
92
|
+
);
|
|
93
|
+
}
|
|
94
|
+
// #endregion Condition checking.
|
|
95
|
+
// #region Referenced Condition checking.
|
|
96
|
+
//
|
|
97
|
+
// For usage in dynamic scenarios (like with AE-DBC).
|
|
98
|
+
//
|
|
99
|
+
/**
|
|
100
|
+
* Invokes the {@link JSON_Parse.checkAlgorithm } passing the value "toCheck" and {@link JSON_Parse.receptor }.
|
|
101
|
+
*
|
|
102
|
+
* @param toCheck See {@link JSON_Parse.checkAlgorithm }.
|
|
103
|
+
*
|
|
104
|
+
* @returns See {@link JSON_Parse.checkAlgorithm}. */
|
|
105
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
106
|
+
public check(toCheck: any) {
|
|
107
|
+
return JSON_Parse.checkAlgorithm(toCheck, this.receptor);
|
|
108
|
+
}
|
|
109
|
+
/**
|
|
110
|
+
* Creates this {@link JSON_Parse } by setting the protected property {@link JSON_Parse.necessaryProperties } and {@link checkElements } used by {@link JSON_Parse.check }.
|
|
111
|
+
*
|
|
112
|
+
* @param necessaryProperties See {@link JSON_Parse.check }.
|
|
113
|
+
* @param checkElements See {@link JSON_Parse.check }. */
|
|
114
|
+
public constructor(public receptor: (json: object) => void) {
|
|
115
|
+
super();
|
|
116
|
+
}
|
|
117
|
+
// #endregion Referenced Condition checking.
|
|
118
|
+
// #region In-Method checking.
|
|
119
|
+
/**
|
|
120
|
+
* Invokes the {@link JSON_Parse.checkAlgorithm } passing the value "toCheck", {@link JSON_Parse.necessaryProperties } and {@link JSON_Parse.checkElements }.
|
|
121
|
+
*
|
|
122
|
+
* @param toCheck See {@link JSON_Parse.checkAlgorithm} }.
|
|
123
|
+
* @param necessaryProperties See {@link JSON_Parse.checkAlgorithm} }.
|
|
124
|
+
* @param checkElements See {@link JSON_Parse.checkAlgorithm} }.
|
|
125
|
+
*/
|
|
126
|
+
public static check(
|
|
127
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
128
|
+
toCheck: any,
|
|
129
|
+
receptor: (json: object) => void,
|
|
130
|
+
) {
|
|
131
|
+
const checkResult = JSON_Parse.checkAlgorithm(toCheck, receptor);
|
|
132
|
+
|
|
133
|
+
if (typeof checkResult === "string") {
|
|
134
|
+
throw new DBC.Infringement(checkResult);
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
// #endregion In-Method checking.
|
|
138
|
+
}
|
package/src/DBC/REGEX.ts
ADDED
|
@@ -0,0 +1,139 @@
|
|
|
1
|
+
import { DBC } from "../DBC.js";
|
|
2
|
+
/**
|
|
3
|
+
* A {@link DBC } providing {@link REGEX }-contracts and standard {@link RegExp } for common use cases in {@link REGEX.stdExp }.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Maintainer: Callari, Salvatore (XDBC@WaXCode.net) */
|
|
7
|
+
export class REGEX extends DBC {
|
|
8
|
+
/** Stores often used {@link RegExp }s. */
|
|
9
|
+
public static stdExp = {
|
|
10
|
+
property: /^[$_A-Za-z][$_A-Za-z0-9]*$/,
|
|
11
|
+
url: /^(?:(?:https?|ftp):\/\/)(?:\S+(?::\S*)?@)?(?:(?!(?:10|127)(?:\.\d{1,3}){3})(?!(?:169\.254|192\.168)(?:\.\d{1,3}){2})(?!172\.(?:1[6-9]|2\d|3[0-1])(?:\.\d{1,3}){2})(?:[1-9]\d?|1\d\d|2[01]\d|22[0-3])(?:\.(?:1?\d{1,2}|2[0-4]\d|25[0-5])){2}(?:\.(?:[1-9]\d?|1\d\d|2[0-4]\d|25[0-4]))|(?:(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)(?:\.(?:[a-z\u00a1-\uffff0-9]-*)*[a-z\u00a1-\uffff0-9]+)*(?:\.(?:[a-z\u00a1-\uffff]{2,}))\.?)(?::\d{2,5})?(?:[/?#]\S*)?$/i,
|
|
12
|
+
keyPath: /^([a-zA-Z_$][a-zA-Z0-9_$]*\.)*[a-zA-Z_$][a-zA-Z0-9_$]*$/,
|
|
13
|
+
date: /^\d{1,4}[.\/-]\d{1,2}[.\/-]\d{1,4}$/i,
|
|
14
|
+
dateFormat:
|
|
15
|
+
/^((D{1,2}[./-]M{1,2}[./-]Y{1,4})|(M{1,2}[./-]D{1,2}[./-]Y{1,4})|Y{1,4}[./-]D{1,2}[./-]M{1,2}|(Y{1,4}[./-]M{1,2}[./-]D{1,2}))$/i,
|
|
16
|
+
cssSelector:
|
|
17
|
+
/^(?:\*|#[\w-]+|\.[\w-]+|(?:[\w-]+|\*)(?::(?:[\w-]+(?:\([\w-]+\))?)+)?(?:\[(?:[\w-]+(?:(?:=|~=|\|=|\*=|\$=|\^=)\s*(?:"[^"]*"|'[^']*'|[\w-]+)\s*)?)?\])+|\[\s*[\w-]+\s*=\s*(?:"[^"]*"|'[^']*'|[\w-]+)\s*\])(?:,\s*(?:\*|#[\w-]+|\.[\w-]+|(?:[\w-]+|\*)(?::(?:[\w-]+(?:\([\w-]+\))?)+)?(?:\[(?:[\w-]+(?:(?:=|~=|\|=|\*=|\$=|\^=)\s*(?:"[^"]*"|'[^']*'|[\w-]+)\s*)?)?\])+|\[\s*[\w-]+\s*=\s*(?:"[^"]*"|'[^']*'|[\w-]+)\s*\]))*$/,
|
|
18
|
+
};
|
|
19
|
+
// #region Condition checking.
|
|
20
|
+
/**
|
|
21
|
+
* Checks if the value "toCheck" is complies to the {@link RegExp } "expression".
|
|
22
|
+
*
|
|
23
|
+
* @param toCheck The value that has comply to the {@link RegExp } "expression" for this {@link DBC } to be fulfilled.
|
|
24
|
+
* @param expression The {@link RegExp } the one "toCheck" has comply to in order for this {@link DBC } to be
|
|
25
|
+
* fulfilled.
|
|
26
|
+
*
|
|
27
|
+
* @returns TRUE if the value "toCheck" complies with the {@link RegExp } "expression", otherwise FALSE. */
|
|
28
|
+
public static checkAlgorithm(
|
|
29
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
30
|
+
toCheck: any,
|
|
31
|
+
expression: RegExp,
|
|
32
|
+
): boolean | string {
|
|
33
|
+
if (!expression.test(toCheck as string)) {
|
|
34
|
+
return `Value has to comply to regular expression "${expression}"`;
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return true;
|
|
38
|
+
}
|
|
39
|
+
/**
|
|
40
|
+
* A parameter-decorator factory using the {@link REGEX.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
41
|
+
* by the tagged parameter.
|
|
42
|
+
*
|
|
43
|
+
* @param expression See {@link REGEX.checkAlgorithm }.
|
|
44
|
+
* @param path See {@link DBC.decPrecondition }.
|
|
45
|
+
* @param dbc See {@link DBC.decPrecondition }.
|
|
46
|
+
*
|
|
47
|
+
* @returns See {@link DBC.decPrecondition }. */
|
|
48
|
+
public static PRE(
|
|
49
|
+
expression: RegExp,
|
|
50
|
+
path: string | undefined = undefined,
|
|
51
|
+
dbc = "WaXCode.DBC",
|
|
52
|
+
): (
|
|
53
|
+
target: object,
|
|
54
|
+
methodName: string | symbol,
|
|
55
|
+
parameterIndex: number,
|
|
56
|
+
) => void {
|
|
57
|
+
return DBC.decPrecondition(
|
|
58
|
+
(
|
|
59
|
+
value: string,
|
|
60
|
+
target: object,
|
|
61
|
+
methodName: string,
|
|
62
|
+
parameterIndex: number,
|
|
63
|
+
) => {
|
|
64
|
+
return REGEX.checkAlgorithm(value, expression);
|
|
65
|
+
},
|
|
66
|
+
dbc,
|
|
67
|
+
path,
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
/**
|
|
71
|
+
* A method-decorator factory using the {@link REGEX.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
72
|
+
* by the tagged method's returnvalue.
|
|
73
|
+
*
|
|
74
|
+
* @param expression See {@link REGEX.checkAlgorithm }.
|
|
75
|
+
* @param path See {@link DBC.Postcondition }.
|
|
76
|
+
* @param dbc See {@link DBC.decPostcondition }.
|
|
77
|
+
*
|
|
78
|
+
* @returns See {@link DBC.decPostcondition }. */
|
|
79
|
+
public static POST(
|
|
80
|
+
expression: RegExp,
|
|
81
|
+
path: string | undefined = undefined,
|
|
82
|
+
dbc = "WaXCode.DBC",
|
|
83
|
+
): (
|
|
84
|
+
target: object,
|
|
85
|
+
propertyKey: string,
|
|
86
|
+
descriptor: PropertyDescriptor,
|
|
87
|
+
) => PropertyDescriptor {
|
|
88
|
+
return DBC.decPostcondition(
|
|
89
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
90
|
+
(value: any, target: object, propertyKey: string) => {
|
|
91
|
+
return REGEX.checkAlgorithm(value, expression);
|
|
92
|
+
},
|
|
93
|
+
dbc,
|
|
94
|
+
path,
|
|
95
|
+
);
|
|
96
|
+
}
|
|
97
|
+
// #endregion Condition checking.
|
|
98
|
+
// #region Referenced Condition checking.
|
|
99
|
+
//
|
|
100
|
+
// For usage in dynamic scenarios (like with AE-DBC).
|
|
101
|
+
//
|
|
102
|
+
/**
|
|
103
|
+
* Invokes the {@link EQ.checkAlgorithm } passing the value "toCheck" and {@link EQ.equivalent }.
|
|
104
|
+
*
|
|
105
|
+
* @param toCheck See {@link EQ.checkAlgorithm }.
|
|
106
|
+
*
|
|
107
|
+
* @returns See {@link EQ.checkAlgorithm}. */
|
|
108
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
109
|
+
public check(toCheck: any) {
|
|
110
|
+
return REGEX.checkAlgorithm(toCheck, this.expression);
|
|
111
|
+
}
|
|
112
|
+
/**
|
|
113
|
+
* Creates this {@link REGEX } by setting the protected property {@link REGEX.expression } used by {@link REGEX.check }.
|
|
114
|
+
*
|
|
115
|
+
* @param expression See {@link REGEX.check }. */
|
|
116
|
+
public constructor(protected expression: RegExp) {
|
|
117
|
+
super();
|
|
118
|
+
}
|
|
119
|
+
// #endregion Referenced Condition checking.
|
|
120
|
+
// #region In-Method checking.
|
|
121
|
+
/**
|
|
122
|
+
* Invokes the {@link JSON_OP.checkAlgorithm } passing the value "toCheck" and {@link JSON_OP.expression }.
|
|
123
|
+
*
|
|
124
|
+
* @param toCheck See {@link JSON_OP.checkAlgorithm} }.
|
|
125
|
+
* @param expression See {@link JSON_OP.checkAlgorithm} }.
|
|
126
|
+
*/
|
|
127
|
+
public static check(
|
|
128
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
129
|
+
toCheck: any,
|
|
130
|
+
expression: RegExp,
|
|
131
|
+
) {
|
|
132
|
+
const checkResult = REGEX.checkAlgorithm(toCheck, expression);
|
|
133
|
+
|
|
134
|
+
if (typeof checkResult === "string") {
|
|
135
|
+
throw new DBC.Infringement(checkResult);
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
// #endregion In-Method checking.
|
|
139
|
+
}
|
package/src/DBC/TYPE.ts
ADDED
|
@@ -0,0 +1,104 @@
|
|
|
1
|
+
import { DBC } from "../DBC.js";
|
|
2
|
+
/**
|
|
3
|
+
* A {@link DBC } defining that the an {@link object }s gotta be of certain {@link TYPE.type }.
|
|
4
|
+
*
|
|
5
|
+
* @remarks
|
|
6
|
+
* Author: Salvatore Callari (Callari@WaXCode.net) / 2025
|
|
7
|
+
* Maintainer: Salvatore Callari (XDBC@WaXCode.net) */
|
|
8
|
+
export class TYPE extends DBC {
|
|
9
|
+
/**
|
|
10
|
+
* Checks if the value "toCheck" is of the "type" specified.
|
|
11
|
+
*
|
|
12
|
+
* @param toCheck The {@link Object } which'S "type" to check.
|
|
13
|
+
* @param type The type the {@link object} "toCheck" has to be of.
|
|
14
|
+
*
|
|
15
|
+
* @returns TRUE if the value "toCheck" is of the specified "type", otherwise FALSE. */
|
|
16
|
+
// biome-ignore lint/suspicious/noExplicitAny: Necessary for dynamic type checking of also UNDEFINED.
|
|
17
|
+
public static checkAlgorithm(toCheck: any, type: string): boolean | string {
|
|
18
|
+
// biome-ignore lint/suspicious/useValidTypeof: Necessary
|
|
19
|
+
if (typeof toCheck !== type) {
|
|
20
|
+
return `Value has to to be of type "${type}" but is of type "${typeof toCheck}"`;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
return true;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* A parameter-decorator factory using the {@link TYPE.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
27
|
+
* by the tagged parameter.
|
|
28
|
+
*
|
|
29
|
+
* @param type See {@link TYPE.checkAlgorithm }.
|
|
30
|
+
* @param path See {@link DBC.decPrecondition }.
|
|
31
|
+
* @param dbc See {@link DBC.decPrecondition }.
|
|
32
|
+
*
|
|
33
|
+
* @returns See {@link DBC.decPrecondition }. */
|
|
34
|
+
public static PRE(
|
|
35
|
+
type: string,
|
|
36
|
+
path: string | undefined = undefined,
|
|
37
|
+
dbc = "WaXCode.DBC",
|
|
38
|
+
): (
|
|
39
|
+
target: object,
|
|
40
|
+
methodName: string | symbol,
|
|
41
|
+
parameterIndex: number,
|
|
42
|
+
) => void {
|
|
43
|
+
return DBC.decPrecondition(
|
|
44
|
+
(
|
|
45
|
+
value: object,
|
|
46
|
+
target: object,
|
|
47
|
+
methodName: string,
|
|
48
|
+
parameterIndex: number,
|
|
49
|
+
) => {
|
|
50
|
+
return TYPE.checkAlgorithm(value, type);
|
|
51
|
+
},
|
|
52
|
+
dbc,
|
|
53
|
+
path,
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
/**
|
|
57
|
+
* A method-decorator factory using the {@link TYPE.checkAlgorithm } to determine whether this {@link DBC } is fulfilled
|
|
58
|
+
* by the tagged method's returnvalue.
|
|
59
|
+
*
|
|
60
|
+
* @param type See {@link TYPE.checkAlgorithm }.
|
|
61
|
+
* @param path See {@link DBC.Postcondition }.
|
|
62
|
+
* @param dbc See {@link DBC.decPostcondition }.
|
|
63
|
+
*
|
|
64
|
+
* @returns See {@link DBC.decPostcondition }. */
|
|
65
|
+
public static POST(
|
|
66
|
+
type: string,
|
|
67
|
+
path: string | undefined = undefined,
|
|
68
|
+
dbc = "WaXCode.DBC",
|
|
69
|
+
): (
|
|
70
|
+
target: object,
|
|
71
|
+
propertyKey: string,
|
|
72
|
+
descriptor: PropertyDescriptor,
|
|
73
|
+
) => PropertyDescriptor {
|
|
74
|
+
return DBC.decPostcondition(
|
|
75
|
+
(value: object, target: object, propertyKey: string) => {
|
|
76
|
+
return TYPE.checkAlgorithm(value, type);
|
|
77
|
+
},
|
|
78
|
+
dbc,
|
|
79
|
+
path,
|
|
80
|
+
);
|
|
81
|
+
}
|
|
82
|
+
// #endregion Condition checking.
|
|
83
|
+
// #region Referenced Condition checking.
|
|
84
|
+
//
|
|
85
|
+
// For usage in dynamic scenarios (like with AE-DBC).
|
|
86
|
+
//
|
|
87
|
+
/**
|
|
88
|
+
* Invokes the {@link TYPE.checkAlgorithm } passing the value "toCheck" and the {@link TYPE.type } .
|
|
89
|
+
*
|
|
90
|
+
* @param toCheck See {@link TYPE.checkAlgorithm }.
|
|
91
|
+
*
|
|
92
|
+
* @returns See {@link TYPE.checkAlgorithm}. */
|
|
93
|
+
// biome-ignore lint/suspicious/noExplicitAny: <explanation>
|
|
94
|
+
public check(toCheck: any) {
|
|
95
|
+
return TYPE.checkAlgorithm(toCheck, this.type);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* Creates this {@link TYPE } by setting the protected property {@link TYPE.type } used by {@link TYPE.check }.
|
|
99
|
+
*
|
|
100
|
+
* @param type See {@link TYPE.check }. */
|
|
101
|
+
public constructor(protected type: string) {
|
|
102
|
+
super();
|
|
103
|
+
}
|
|
104
|
+
}
|