@nu-art/ts-common 0.100.19 → 0.101.2
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/core/exceptions.d.ts +81 -1
- package/core/exceptions.js +80 -0
- package/core/exceptions.js.map +1 -1
- package/core/logger/LogClient_Browser.js +6 -6
- package/core/logger/LogClient_Browser.js.map +1 -1
- package/core/module-manager.d.ts +1 -1
- package/core/module-manager.js.map +1 -1
- package/package.json +5 -3
- package/utils/filter-tools.d.ts +124 -1
- package/utils/filter-tools.js +125 -1
- package/utils/filter-tools.js.map +1 -1
- package/utils/types.d.ts +3 -0
- package/utils/types.js +2 -1
- package/utils/types.js.map +1 -1
- package/validator/validator.js +1 -1
- package/validator/validator.js.map +1 -1
package/core/exceptions.d.ts
CHANGED
|
@@ -1,38 +1,118 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Created by TacB0sS on 3/16/17.
|
|
3
3
|
*/
|
|
4
|
-
import { Constructor } from
|
|
4
|
+
import { Constructor } from '../utils/types';
|
|
5
|
+
/**
|
|
6
|
+
* # <ins>isErrorOfType</ins>
|
|
7
|
+
*
|
|
8
|
+
* A function that checks if an error is of a certain type.
|
|
9
|
+
*
|
|
10
|
+
* @param e The error
|
|
11
|
+
* @param _exceptionType The exception class to compare to
|
|
12
|
+
*
|
|
13
|
+
* @returns
|
|
14
|
+
* - T - The error as the type checked if the error was of that type.
|
|
15
|
+
* - undefined - otherwise.
|
|
16
|
+
*
|
|
17
|
+
* #### <ins>Usage:</ins>
|
|
18
|
+
* ```js
|
|
19
|
+
* try {
|
|
20
|
+
* ...
|
|
21
|
+
* } catch(e: Error) {
|
|
22
|
+
* if(isErrorOfType(e,ThisShouldNotHappenException)) {
|
|
23
|
+
* e = new ThisShouldNotHappenException("this should not have happened",e);
|
|
24
|
+
* ...
|
|
25
|
+
* }
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*/
|
|
5
29
|
export declare function isErrorOfType<T extends Error>(e: Error, _exceptionType: Constructor<T>): T | undefined;
|
|
30
|
+
/**
|
|
31
|
+
* # CustomException
|
|
32
|
+
*
|
|
33
|
+
* ### <ins>Intro</ins>
|
|
34
|
+
* An abstract class defining the structure of custom exceptions.<br>
|
|
35
|
+
* This class extends the java-script native Error object.<br>
|
|
36
|
+
* In addition to collecting the error, this class also collects a message and the exception type, for better
|
|
37
|
+
* error handling.<br>
|
|
38
|
+
*
|
|
39
|
+
* @category - Exceptions
|
|
40
|
+
*/
|
|
6
41
|
export declare abstract class CustomException extends Error {
|
|
7
42
|
exceptionType: string;
|
|
8
43
|
isInstanceOf: (_exceptionType: Function) => boolean;
|
|
9
44
|
cause?: Error;
|
|
10
45
|
protected constructor(exceptionType: Function, message: string, cause?: Error);
|
|
11
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* # <ins>Exception</ins>
|
|
49
|
+
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "Exception",
|
|
50
|
+
* @category - Exceptions
|
|
51
|
+
*/
|
|
12
52
|
export declare class Exception extends CustomException {
|
|
13
53
|
constructor(message: string, cause?: Error);
|
|
14
54
|
}
|
|
55
|
+
/**
|
|
56
|
+
* # <ins>BadImplementationException</ins>
|
|
57
|
+
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "BadImplementationException",
|
|
58
|
+
* @category - Exceptions
|
|
59
|
+
*/
|
|
15
60
|
export declare class BadImplementationException extends CustomException {
|
|
16
61
|
constructor(message: string, cause?: Error);
|
|
17
62
|
}
|
|
63
|
+
/**
|
|
64
|
+
* # <ins>ImplementationMissingException</ins>
|
|
65
|
+
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "ImplementationMissingException",
|
|
66
|
+
* @category - Exceptions
|
|
67
|
+
*/
|
|
18
68
|
export declare class ImplementationMissingException extends CustomException {
|
|
19
69
|
constructor(message: string, cause?: Error);
|
|
20
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* # <ins>MUSTNeverHappenException</ins>
|
|
73
|
+
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "MUSTNeverHappenException",
|
|
74
|
+
* @category - Exceptions
|
|
75
|
+
*/
|
|
21
76
|
export declare class MUSTNeverHappenException extends CustomException {
|
|
22
77
|
constructor(message: string, cause?: Error);
|
|
23
78
|
}
|
|
79
|
+
/**
|
|
80
|
+
* # <ins>NotImplementedYetException</ins>
|
|
81
|
+
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "NotImplementedYetException",
|
|
82
|
+
* @category - Exceptions
|
|
83
|
+
*/
|
|
24
84
|
export declare class NotImplementedYetException extends CustomException {
|
|
25
85
|
constructor(message: string, cause?: Error);
|
|
26
86
|
}
|
|
87
|
+
/**
|
|
88
|
+
* # <ins>ThisShouldNotHappenException</ins>
|
|
89
|
+
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "ThisShouldNotHappenException",
|
|
90
|
+
* @category - Exceptions
|
|
91
|
+
*/
|
|
27
92
|
export declare class ThisShouldNotHappenException extends CustomException {
|
|
28
93
|
constructor(message: string, cause?: Error);
|
|
29
94
|
}
|
|
95
|
+
/**
|
|
96
|
+
* # <ins>DontCallthisException</ins>
|
|
97
|
+
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "DontCallthisException",
|
|
98
|
+
* @category - Exceptions
|
|
99
|
+
*/
|
|
30
100
|
export declare class DontCallthisException extends CustomException {
|
|
31
101
|
constructor(message: string, cause?: Error);
|
|
32
102
|
}
|
|
103
|
+
/**
|
|
104
|
+
* # <ins>WhoCallthisException</ins>
|
|
105
|
+
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "WhoCallthisException",
|
|
106
|
+
* @category - Exceptions
|
|
107
|
+
*/
|
|
33
108
|
export declare class WhoCallthisException extends CustomException {
|
|
34
109
|
constructor(message: string, cause?: Error);
|
|
35
110
|
}
|
|
111
|
+
/**
|
|
112
|
+
* # <ins>AssertionException</ins>
|
|
113
|
+
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "AssertionException",
|
|
114
|
+
* @category - Exceptions
|
|
115
|
+
*/
|
|
36
116
|
export declare class AssertionException extends CustomException {
|
|
37
117
|
constructor(message: string, cause?: Error);
|
|
38
118
|
}
|
package/core/exceptions.js
CHANGED
|
@@ -36,12 +36,47 @@ var __extends = (this && this.__extends) || (function () {
|
|
|
36
36
|
})();
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
38
|
exports.AssertionException = exports.WhoCallthisException = exports.DontCallthisException = exports.ThisShouldNotHappenException = exports.NotImplementedYetException = exports.MUSTNeverHappenException = exports.ImplementationMissingException = exports.BadImplementationException = exports.Exception = exports.CustomException = exports.isErrorOfType = void 0;
|
|
39
|
+
/**
|
|
40
|
+
* # <ins>isErrorOfType</ins>
|
|
41
|
+
*
|
|
42
|
+
* A function that checks if an error is of a certain type.
|
|
43
|
+
*
|
|
44
|
+
* @param e The error
|
|
45
|
+
* @param _exceptionType The exception class to compare to
|
|
46
|
+
*
|
|
47
|
+
* @returns
|
|
48
|
+
* - T - The error as the type checked if the error was of that type.
|
|
49
|
+
* - undefined - otherwise.
|
|
50
|
+
*
|
|
51
|
+
* #### <ins>Usage:</ins>
|
|
52
|
+
* ```js
|
|
53
|
+
* try {
|
|
54
|
+
* ...
|
|
55
|
+
* } catch(e: Error) {
|
|
56
|
+
* if(isErrorOfType(e,ThisShouldNotHappenException)) {
|
|
57
|
+
* e = new ThisShouldNotHappenException("this should not have happened",e);
|
|
58
|
+
* ...
|
|
59
|
+
* }
|
|
60
|
+
* }
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
39
63
|
function isErrorOfType(e, _exceptionType) {
|
|
40
64
|
var _e = e;
|
|
41
65
|
if (_e.isInstanceOf && _e.isInstanceOf(_exceptionType))
|
|
42
66
|
return e;
|
|
43
67
|
}
|
|
44
68
|
exports.isErrorOfType = isErrorOfType;
|
|
69
|
+
/**
|
|
70
|
+
* # CustomException
|
|
71
|
+
*
|
|
72
|
+
* ### <ins>Intro</ins>
|
|
73
|
+
* An abstract class defining the structure of custom exceptions.<br>
|
|
74
|
+
* This class extends the java-script native Error object.<br>
|
|
75
|
+
* In addition to collecting the error, this class also collects a message and the exception type, for better
|
|
76
|
+
* error handling.<br>
|
|
77
|
+
*
|
|
78
|
+
* @category - Exceptions
|
|
79
|
+
*/
|
|
45
80
|
var CustomException = /** @class */ (function (_super) {
|
|
46
81
|
__extends(CustomException, _super);
|
|
47
82
|
function CustomException(exceptionType, message, cause) {
|
|
@@ -58,6 +93,11 @@ var CustomException = /** @class */ (function (_super) {
|
|
|
58
93
|
return CustomException;
|
|
59
94
|
}(Error));
|
|
60
95
|
exports.CustomException = CustomException;
|
|
96
|
+
/**
|
|
97
|
+
* # <ins>Exception</ins>
|
|
98
|
+
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "Exception",
|
|
99
|
+
* @category - Exceptions
|
|
100
|
+
*/
|
|
61
101
|
var Exception = /** @class */ (function (_super) {
|
|
62
102
|
__extends(Exception, _super);
|
|
63
103
|
function Exception(message, cause) {
|
|
@@ -66,6 +106,11 @@ var Exception = /** @class */ (function (_super) {
|
|
|
66
106
|
return Exception;
|
|
67
107
|
}(CustomException));
|
|
68
108
|
exports.Exception = Exception;
|
|
109
|
+
/**
|
|
110
|
+
* # <ins>BadImplementationException</ins>
|
|
111
|
+
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "BadImplementationException",
|
|
112
|
+
* @category - Exceptions
|
|
113
|
+
*/
|
|
69
114
|
var BadImplementationException = /** @class */ (function (_super) {
|
|
70
115
|
__extends(BadImplementationException, _super);
|
|
71
116
|
function BadImplementationException(message, cause) {
|
|
@@ -74,6 +119,11 @@ var BadImplementationException = /** @class */ (function (_super) {
|
|
|
74
119
|
return BadImplementationException;
|
|
75
120
|
}(CustomException));
|
|
76
121
|
exports.BadImplementationException = BadImplementationException;
|
|
122
|
+
/**
|
|
123
|
+
* # <ins>ImplementationMissingException</ins>
|
|
124
|
+
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "ImplementationMissingException",
|
|
125
|
+
* @category - Exceptions
|
|
126
|
+
*/
|
|
77
127
|
var ImplementationMissingException = /** @class */ (function (_super) {
|
|
78
128
|
__extends(ImplementationMissingException, _super);
|
|
79
129
|
function ImplementationMissingException(message, cause) {
|
|
@@ -82,6 +132,11 @@ var ImplementationMissingException = /** @class */ (function (_super) {
|
|
|
82
132
|
return ImplementationMissingException;
|
|
83
133
|
}(CustomException));
|
|
84
134
|
exports.ImplementationMissingException = ImplementationMissingException;
|
|
135
|
+
/**
|
|
136
|
+
* # <ins>MUSTNeverHappenException</ins>
|
|
137
|
+
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "MUSTNeverHappenException",
|
|
138
|
+
* @category - Exceptions
|
|
139
|
+
*/
|
|
85
140
|
var MUSTNeverHappenException = /** @class */ (function (_super) {
|
|
86
141
|
__extends(MUSTNeverHappenException, _super);
|
|
87
142
|
function MUSTNeverHappenException(message, cause) {
|
|
@@ -90,6 +145,11 @@ var MUSTNeverHappenException = /** @class */ (function (_super) {
|
|
|
90
145
|
return MUSTNeverHappenException;
|
|
91
146
|
}(CustomException));
|
|
92
147
|
exports.MUSTNeverHappenException = MUSTNeverHappenException;
|
|
148
|
+
/**
|
|
149
|
+
* # <ins>NotImplementedYetException</ins>
|
|
150
|
+
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "NotImplementedYetException",
|
|
151
|
+
* @category - Exceptions
|
|
152
|
+
*/
|
|
93
153
|
var NotImplementedYetException = /** @class */ (function (_super) {
|
|
94
154
|
__extends(NotImplementedYetException, _super);
|
|
95
155
|
function NotImplementedYetException(message, cause) {
|
|
@@ -98,6 +158,11 @@ var NotImplementedYetException = /** @class */ (function (_super) {
|
|
|
98
158
|
return NotImplementedYetException;
|
|
99
159
|
}(CustomException));
|
|
100
160
|
exports.NotImplementedYetException = NotImplementedYetException;
|
|
161
|
+
/**
|
|
162
|
+
* # <ins>ThisShouldNotHappenException</ins>
|
|
163
|
+
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "ThisShouldNotHappenException",
|
|
164
|
+
* @category - Exceptions
|
|
165
|
+
*/
|
|
101
166
|
var ThisShouldNotHappenException = /** @class */ (function (_super) {
|
|
102
167
|
__extends(ThisShouldNotHappenException, _super);
|
|
103
168
|
function ThisShouldNotHappenException(message, cause) {
|
|
@@ -106,6 +171,11 @@ var ThisShouldNotHappenException = /** @class */ (function (_super) {
|
|
|
106
171
|
return ThisShouldNotHappenException;
|
|
107
172
|
}(CustomException));
|
|
108
173
|
exports.ThisShouldNotHappenException = ThisShouldNotHappenException;
|
|
174
|
+
/**
|
|
175
|
+
* # <ins>DontCallthisException</ins>
|
|
176
|
+
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "DontCallthisException",
|
|
177
|
+
* @category - Exceptions
|
|
178
|
+
*/
|
|
109
179
|
var DontCallthisException = /** @class */ (function (_super) {
|
|
110
180
|
__extends(DontCallthisException, _super);
|
|
111
181
|
function DontCallthisException(message, cause) {
|
|
@@ -114,6 +184,11 @@ var DontCallthisException = /** @class */ (function (_super) {
|
|
|
114
184
|
return DontCallthisException;
|
|
115
185
|
}(CustomException));
|
|
116
186
|
exports.DontCallthisException = DontCallthisException;
|
|
187
|
+
/**
|
|
188
|
+
* # <ins>WhoCallthisException</ins>
|
|
189
|
+
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "WhoCallthisException",
|
|
190
|
+
* @category - Exceptions
|
|
191
|
+
*/
|
|
117
192
|
var WhoCallthisException = /** @class */ (function (_super) {
|
|
118
193
|
__extends(WhoCallthisException, _super);
|
|
119
194
|
function WhoCallthisException(message, cause) {
|
|
@@ -122,6 +197,11 @@ var WhoCallthisException = /** @class */ (function (_super) {
|
|
|
122
197
|
return WhoCallthisException;
|
|
123
198
|
}(CustomException));
|
|
124
199
|
exports.WhoCallthisException = WhoCallthisException;
|
|
200
|
+
/**
|
|
201
|
+
* # <ins>AssertionException</ins>
|
|
202
|
+
* This class inherits {@link CustomException} and functions like it, after setting the exceptionType property as "AssertionException",
|
|
203
|
+
* @category - Exceptions
|
|
204
|
+
*/
|
|
125
205
|
var AssertionException = /** @class */ (function (_super) {
|
|
126
206
|
__extends(AssertionException, _super);
|
|
127
207
|
function AssertionException(message, cause) {
|
package/core/exceptions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../../src/main/core/exceptions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;AACH;;GAEG;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"exceptions.js","sourceRoot":"","sources":["../../src/main/core/exceptions.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;AACH;;GAEG;;;;;;;;;;;;;;;;;;AAMH;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,SAAgB,aAAa,CAAkB,CAAQ,EAAE,cAA8B;IACtF,IAAM,EAAE,GAAG,CAAQ,CAAC;IACpB,IAAI,EAAE,CAAC,YAAY,IAAI,EAAE,CAAC,YAAY,CAAC,cAAc,CAAC;QACrD,OAAO,CAAM,CAAC;AAChB,CAAC;AAJD,sCAIC;AAED;;;;;;;;;;GAUG;AACH;IACS,mCAAK;IAOb,yBAAsB,aAAuB,EAAE,OAAe,EAAE,KAAa;QAA7E,YACC,kBAAM,OAAO,CAAC,SAQd;QAPA,KAAI,CAAC,OAAO,GAAG,OAAO,CAAC;QACvB,KAAI,CAAC,KAAK,GAAG,CAAC,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,KAAK,CAAC;QACxC,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,KAAI,CAAC,aAAa,GAAG,aAAa,CAAC,IAAI,CAAC;QACxC,KAAI,CAAC,YAAY,GAAG,UAAC,cAAwB;YAC5C,OAAO,KAAI,CAAC,aAAa,KAAK,cAAc,CAAC,IAAI,CAAC;QACnD,CAAC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;;GAIG;AACH;IACS,yCAAe;IAEvB,+BAAY,OAAe,EAAE,KAAa;eACzC,kBAAM,qBAAqB,EAAE,OAAO,EAAE,KAAK,CAAC;IAC7C,CAAC;IACF,4BAAC;AAAD,CAAC,AAND,CACS,eAAe,GAKvB;AANY,sDAAqB;AAQlC;;;;GAIG;AACH;IACS,wCAAe;IAEvB,8BAAY,OAAe,EAAE,KAAa;eACzC,kBAAM,oBAAoB,EAAE,OAAO,EAAE,KAAK,CAAC;IAC5C,CAAC;IACF,2BAAC;AAAD,CAAC,AAND,CACS,eAAe,GAKvB;AANY,oDAAoB;AAQjC;;;;GAIG;AACH;IACS,sCAAe;IAEvB,4BAAY,OAAe,EAAE,KAAa;eACzC,kBAAM,kBAAkB,EAAE,OAAO,EAAE,KAAK,CAAC;IAC1C,CAAC;IACF,yBAAC;AAAD,CAAC,AAND,CACS,eAAe,GAKvB;AANY,gDAAkB"}
|
|
@@ -42,7 +42,7 @@ var LogClient_Browser_class = /** @class */ (function (_super) {
|
|
|
42
42
|
var _this = _super !== null && _super.apply(this, arguments) || this;
|
|
43
43
|
_this.style = {
|
|
44
44
|
base: {
|
|
45
|
-
'background-color': '#fff',
|
|
45
|
+
// 'background-color': '#fff',
|
|
46
46
|
'padding': '2px 0px',
|
|
47
47
|
'border-radius': '2px',
|
|
48
48
|
},
|
|
@@ -51,16 +51,16 @@ var LogClient_Browser_class = /** @class */ (function (_super) {
|
|
|
51
51
|
'background-color': 'unset'
|
|
52
52
|
},
|
|
53
53
|
debug: {
|
|
54
|
-
'
|
|
54
|
+
'color': '#6564c9',
|
|
55
55
|
},
|
|
56
56
|
info: {
|
|
57
|
-
'
|
|
57
|
+
'color': '#189702',
|
|
58
58
|
},
|
|
59
59
|
warning: {
|
|
60
|
-
'
|
|
60
|
+
'color': '#926E00',
|
|
61
61
|
},
|
|
62
62
|
error: {
|
|
63
|
-
'
|
|
63
|
+
'color': '#B40000',
|
|
64
64
|
}
|
|
65
65
|
};
|
|
66
66
|
return _this;
|
|
@@ -92,7 +92,7 @@ var LogClient_Browser_class = /** @class */ (function (_super) {
|
|
|
92
92
|
console.log("%c".concat(prefix), this.getColor(level, bold), param);
|
|
93
93
|
continue;
|
|
94
94
|
}
|
|
95
|
-
console.log(param);
|
|
95
|
+
console.log("%c".concat(prefix), this.getColor(level, bold), param);
|
|
96
96
|
}
|
|
97
97
|
};
|
|
98
98
|
return LogClient_Browser_class;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"LogClient_Browser.js","sourceRoot":"","sources":["../../../src/main/core/logger/LogClient_Browser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;;;;;;;AAEH,iCAA2C;AAC3C,yCAAsC;AACtC,2BAAsD;AAGtD;IACS,2CAAS;IADlB;QAAA,qEAyDC;QAtDQ,WAAK,GAAuB;YACnC,IAAI,EAAE;gBACL,
|
|
1
|
+
{"version":3,"file":"LogClient_Browser.js","sourceRoot":"","sources":["../../../src/main/core/logger/LogClient_Browser.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;;;;;;;AAEH,iCAA2C;AAC3C,yCAAsC;AACtC,2BAAsD;AAGtD;IACS,2CAAS;IADlB;QAAA,qEAyDC;QAtDQ,WAAK,GAAuB;YACnC,IAAI,EAAE;gBACL,8BAA8B;gBAC9B,SAAS,EAAE,SAAS;gBACpB,eAAe,EAAE,KAAK;aACtB;YACD,OAAO,EAAE;gBACR,OAAO,EAAE,SAAS;gBAClB,kBAAkB,EAAE,OAAO;aAC3B;YACD,KAAK,EAAE;gBACN,OAAO,EAAE,SAAS;aAClB;YACD,IAAI,EAAE;gBACL,OAAO,EAAE,SAAS;aAClB;YACD,OAAO,EAAE;gBACR,OAAO,EAAE,SAAS;aAClB;YACD,KAAK,EAAE;gBACN,OAAO,EAAE,SAAS;aAClB;SACD,CAAC;;IAgCH,CAAC;IA9BA,0CAAQ,GAAR,UAAS,KAAe,EA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AC9B,OAAO,CAAC,GAAG,CAAC,YAAK,MAAM,CAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;gBAC9D,SAAS;aACT;YACD,OAAO,CAAC,GAAG,CAAC,YAAK,MAAM,CAAE,EAAE,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,IAAI,CAAC,EAAE,KAAK,CAAC,CAAC;SAC9D;IACF,CAAC;IACF,8BAAC;AAAD,CAAC,AAzDD,CACS,qBAAS,GAwDjB;AAEY,QAAA,iBAAiB,GAAG,IAAI,uBAAuB,EAAE,CAAC"}
|
package/core/module-manager.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export declare class ModuleManager extends Logger {
|
|
|
9
9
|
protected modules: Module[];
|
|
10
10
|
static instance: ModuleManager;
|
|
11
11
|
protected constructor();
|
|
12
|
-
filterModules<T>(filter: (module:
|
|
12
|
+
filterModules<T>(filter: (module: Module) => boolean): T[];
|
|
13
13
|
setConfig(config: object): this;
|
|
14
14
|
addModules(...modules: Module[]): this;
|
|
15
15
|
setModules(...modules: Module[]): this;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"module-manager.js","sourceRoot":"","sources":["../../src/main/core/module-manager.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;;;;;;;AAMH,2CAAwC;AACxC,2CAAwD;AACxD,0CAAuC;AACvC,oDAAsE;
|
|
1
|
+
{"version":3,"file":"module-manager.js","sourceRoot":"","sources":["../../src/main/core/module-manager.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;;;;;;;AAMH,2CAAwC;AACxC,2CAAwD;AACxD,0CAAuC;AACvC,oDAAsE;AAGtE,IAAM,QAAQ,GAAa,EAAE,CAAC;AAE9B,SAAgB,cAAc;IAC7B,OAAO,QAAQ,CAAC;AACjB,CAAC;AAFD,wCAEC;AAED;IACS,iCA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CAAC,UAAU,CAAC,KAAI,CAAC,CAAC;YAExB,IAAI,KAAI,CAAC,MAAM;gBACd,aAAa;gBACb,MAAM,CAAC,SAAS,CAAC,KAAI,CAAC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,CAAC,CAAC,CAAC;QAClD,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAA,MAAM;YAC1B,KAAI,CAAC,QAAQ,CAAC,qBAAc,MAAM,CAAC,OAAO,EAAE,gBAAa,CAAC,CAAC;YAC3D,aAAa;YACb,MAAM,CAAC,IAAI,EAAE,CAAC;YACd,aAAa;YACb,MAAM,CAAC,SAAS,GAAG,IAAI,CAAC;QACzB,CAAC,CAAC,CAAC;QAEH,aAAa;QACb,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,UAAA,MAAM,IAAI,OAAA,MAAM,CAAC,QAAQ,EAAE,EAAjB,CAAiB,CAAC,CAAC;QAElD,IAAI,CAAC,OAAO,CAAC,mCAAmC,CAAC,CAAC;QAClD,OAAO,IAAI,CAAC;IACb,CAAC;IAED,6BAAK,GAAL;QACC,IAAI,CAAC,IAAI,EAAE,CAAC;IACb,CAAC;IACF,oBAAC;AAAD,CAAC,AAtED,CACS,eAAM,GAqEd;AAtEY,sCAAa"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nu-art/ts-common",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.101.2",
|
|
4
4
|
"description": "js and ts infra",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"TacB0sS",
|
|
@@ -23,7 +23,8 @@
|
|
|
23
23
|
"main": "index.js",
|
|
24
24
|
"types": "index.d.ts",
|
|
25
25
|
"scripts": {
|
|
26
|
-
"build": "tsc"
|
|
26
|
+
"build": "tsc",
|
|
27
|
+
"typedocs": "typedoc --options typedoc.json"
|
|
27
28
|
},
|
|
28
29
|
"dependencies": {
|
|
29
30
|
"moment": "^2.24.0",
|
|
@@ -36,7 +37,8 @@
|
|
|
36
37
|
"csv-parser": "^2.3.3",
|
|
37
38
|
"eslint": "^6.8.0",
|
|
38
39
|
"ts-node": "^8.6.2",
|
|
39
|
-
"typescript": "^4.5.0"
|
|
40
|
+
"typescript": "^4.5.0",
|
|
41
|
+
"typedoc": "^0.22"
|
|
40
42
|
},
|
|
41
43
|
"_moduleAliases": {
|
|
42
44
|
"@main": "dist/main/ts",
|
package/utils/filter-tools.d.ts
CHANGED
|
@@ -1,12 +1,135 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* # Filter
|
|
3
|
+
*
|
|
4
|
+
* ## <ins>Intro:</ins>
|
|
5
|
+
*
|
|
6
|
+
* A filter tool for filtering a collection or testing items by comparing string values</br>
|
|
7
|
+
* This tool aims to simplify filtering arrays of strings or objects containing string fields
|
|
8
|
+
* by defining which fields are tested (via a mapper function) testing those fields against a string
|
|
9
|
+
*
|
|
10
|
+
* ## <ins>Example data:</ins>
|
|
11
|
+
*
|
|
12
|
+
* type T in the following examples will be:
|
|
13
|
+
*
|
|
14
|
+
* ```js
|
|
15
|
+
* type T = {
|
|
16
|
+
* name: string;
|
|
17
|
+
* }
|
|
18
|
+
* ```
|
|
19
|
+
*
|
|
20
|
+
* items:
|
|
21
|
+
* ```js
|
|
22
|
+
* const item1: T = {name: 'Matan'};
|
|
23
|
+
* const item2: T = {name: 'Adam'};
|
|
24
|
+
* const item3: T = {name: 'Itay'};
|
|
25
|
+
* const items: T[] = [item1, item2, item3];
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
1
28
|
export declare class Filter<T> {
|
|
2
29
|
private regexp;
|
|
3
30
|
private readonly mapper;
|
|
4
31
|
private originFilterText?;
|
|
5
32
|
private _filter;
|
|
33
|
+
/**
|
|
34
|
+
* Returns an instance of a filter, where the tested fields are the one provided by the mapper.
|
|
35
|
+
*
|
|
36
|
+
* @param mapper a function that returns a string array
|
|
37
|
+
*
|
|
38
|
+
* @return
|
|
39
|
+
*
|
|
40
|
+
* #### <ins>Usage:</ins>
|
|
41
|
+
* ```js
|
|
42
|
+
* //Prepares a filter instance where tests are run on the item.name
|
|
43
|
+
* const filter = new Filter<T>((item)=>[item.name]);
|
|
44
|
+
* ```
|
|
45
|
+
*/
|
|
6
46
|
constructor(mapper: (item: T) => string[]);
|
|
47
|
+
/**
|
|
48
|
+
* A function to set the Filter.regexp boolean flag
|
|
49
|
+
*
|
|
50
|
+
* @param regexp
|
|
51
|
+
* </br>
|
|
52
|
+
* @returns - the Filter instance
|
|
53
|
+
* </br></br>
|
|
54
|
+
*
|
|
55
|
+
* #### <ins>Usage:</ins>
|
|
56
|
+
* ```js
|
|
57
|
+
* const filter = new Filter().setRegexp(false);
|
|
58
|
+
* ```
|
|
59
|
+
*
|
|
60
|
+
*/
|
|
7
61
|
setRegexp(regexp: boolean): this;
|
|
62
|
+
/**
|
|
63
|
+
* A function returning a boolean value for if the item passes the filter</br>
|
|
64
|
+
* The function checks the item fields (based on the mapper given when the Filter instance was created) against the filterText argument
|
|
65
|
+
*
|
|
66
|
+
* @param item The item to check
|
|
67
|
+
* @param filterText A string to filter by
|
|
68
|
+
*
|
|
69
|
+
* @return
|
|
70
|
+
*
|
|
71
|
+
* </br>
|
|
72
|
+
*
|
|
73
|
+
* #### <ins>Usage:</ins>
|
|
74
|
+
* ```js
|
|
75
|
+
* const item: T = {name: 'Matan'}
|
|
76
|
+
*
|
|
77
|
+
* //Will print 'true'
|
|
78
|
+
* console.log(filter.filterItem(item, 'Matan'))
|
|
79
|
+
*
|
|
80
|
+
* //Will print 'false'
|
|
81
|
+
* console.log(filter.filterItem(item, 'Adam'))
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
8
84
|
filterItem(item: T, filterText: string): boolean;
|
|
85
|
+
/**
|
|
86
|
+
* A function returning an array of items that pass the filter</br>
|
|
87
|
+
* The function checks each item's fields (based on the mapper given when the Filter instance was created) against the filterText argument.
|
|
88
|
+
*
|
|
89
|
+
* @param items An array of items to check
|
|
90
|
+
* @param filterText - A string to filter by
|
|
91
|
+
*
|
|
92
|
+
* @return
|
|
93
|
+
*
|
|
94
|
+
* </br>
|
|
95
|
+
*
|
|
96
|
+
* #### <ins>Usage:</ins>
|
|
97
|
+
* ```js
|
|
98
|
+
* //Will return [item2]
|
|
99
|
+
* const filteredItems = filter.filter(items,'Adam');
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
9
102
|
filter(items: T[], filterText: string): T[];
|
|
103
|
+
/**
|
|
104
|
+
* A function return a boolean value as to if any of the item fields passes the Filter._filter</br>
|
|
105
|
+
* Regular expression set by the "setRegexp" function.</br>
|
|
106
|
+
* This function serves as a "default mapper" to pass to a prototype.filter function instead of using this Filter functionality.
|
|
107
|
+
*
|
|
108
|
+
* @param item The item to check
|
|
109
|
+
*
|
|
110
|
+
* @return
|
|
111
|
+
*
|
|
112
|
+
* #### <ins>Usage:</ins>
|
|
113
|
+
* ```js
|
|
114
|
+
* const filter = new Filter();
|
|
115
|
+
*
|
|
116
|
+
* filter.prepareFilter('REGEX');
|
|
117
|
+
*
|
|
118
|
+
* const filteredItems = [item1,item2,item3].filter(filter.filterImpl);
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
10
121
|
filterImpl: (item: T) => boolean;
|
|
11
|
-
|
|
122
|
+
/**
|
|
123
|
+
* A function that sets the Filter instance's filter text and regex.
|
|
124
|
+
*
|
|
125
|
+
* @param filter a filter string
|
|
126
|
+
*
|
|
127
|
+
* @returns - the Filter instance
|
|
128
|
+
*
|
|
129
|
+
* #### <ins>Usage:</ins>
|
|
130
|
+
* ```js
|
|
131
|
+
* const filter = new Filter().prepareFilter('REGEX');
|
|
132
|
+
* ```
|
|
133
|
+
*/
|
|
134
|
+
prepareFilter(filter?: string): this;
|
|
12
135
|
}
|
package/utils/filter-tools.js
CHANGED
|
@@ -18,10 +18,68 @@
|
|
|
18
18
|
*/
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
20
|
exports.Filter = void 0;
|
|
21
|
+
/**
|
|
22
|
+
* # Filter
|
|
23
|
+
*
|
|
24
|
+
* ## <ins>Intro:</ins>
|
|
25
|
+
*
|
|
26
|
+
* A filter tool for filtering a collection or testing items by comparing string values</br>
|
|
27
|
+
* This tool aims to simplify filtering arrays of strings or objects containing string fields
|
|
28
|
+
* by defining which fields are tested (via a mapper function) testing those fields against a string
|
|
29
|
+
*
|
|
30
|
+
* ## <ins>Example data:</ins>
|
|
31
|
+
*
|
|
32
|
+
* type T in the following examples will be:
|
|
33
|
+
*
|
|
34
|
+
* ```js
|
|
35
|
+
* type T = {
|
|
36
|
+
* name: string;
|
|
37
|
+
* }
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* items:
|
|
41
|
+
* ```js
|
|
42
|
+
* const item1: T = {name: 'Matan'};
|
|
43
|
+
* const item2: T = {name: 'Adam'};
|
|
44
|
+
* const item3: T = {name: 'Itay'};
|
|
45
|
+
* const items: T[] = [item1, item2, item3];
|
|
46
|
+
* ```
|
|
47
|
+
*/
|
|
21
48
|
var Filter = /** @class */ (function () {
|
|
49
|
+
/**
|
|
50
|
+
* Returns an instance of a filter, where the tested fields are the one provided by the mapper.
|
|
51
|
+
*
|
|
52
|
+
* @param mapper a function that returns a string array
|
|
53
|
+
*
|
|
54
|
+
* @return
|
|
55
|
+
*
|
|
56
|
+
* #### <ins>Usage:</ins>
|
|
57
|
+
* ```js
|
|
58
|
+
* //Prepares a filter instance where tests are run on the item.name
|
|
59
|
+
* const filter = new Filter<T>((item)=>[item.name]);
|
|
60
|
+
* ```
|
|
61
|
+
*/
|
|
22
62
|
function Filter(mapper) {
|
|
23
63
|
var _this = this;
|
|
24
64
|
this.regexp = true;
|
|
65
|
+
/**
|
|
66
|
+
* A function return a boolean value as to if any of the item fields passes the Filter._filter</br>
|
|
67
|
+
* Regular expression set by the "setRegexp" function.</br>
|
|
68
|
+
* This function serves as a "default mapper" to pass to a prototype.filter function instead of using this Filter functionality.
|
|
69
|
+
*
|
|
70
|
+
* @param item The item to check
|
|
71
|
+
*
|
|
72
|
+
* @return
|
|
73
|
+
*
|
|
74
|
+
* #### <ins>Usage:</ins>
|
|
75
|
+
* ```js
|
|
76
|
+
* const filter = new Filter();
|
|
77
|
+
*
|
|
78
|
+
* filter.prepareFilter('REGEX');
|
|
79
|
+
*
|
|
80
|
+
* const filteredItems = [item1,item2,item3].filter(filter.filterImpl);
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
25
83
|
this.filterImpl = function (item) {
|
|
26
84
|
var keysToFilter = _this.mapper(item);
|
|
27
85
|
for (var _i = 0, keysToFilter_1 = keysToFilter; _i < keysToFilter_1.length; _i++) {
|
|
@@ -33,22 +91,87 @@ var Filter = /** @class */ (function () {
|
|
|
33
91
|
};
|
|
34
92
|
this.mapper = mapper;
|
|
35
93
|
}
|
|
94
|
+
/**
|
|
95
|
+
* A function to set the Filter.regexp boolean flag
|
|
96
|
+
*
|
|
97
|
+
* @param regexp
|
|
98
|
+
* </br>
|
|
99
|
+
* @returns - the Filter instance
|
|
100
|
+
* </br></br>
|
|
101
|
+
*
|
|
102
|
+
* #### <ins>Usage:</ins>
|
|
103
|
+
* ```js
|
|
104
|
+
* const filter = new Filter().setRegexp(false);
|
|
105
|
+
* ```
|
|
106
|
+
*
|
|
107
|
+
*/
|
|
36
108
|
Filter.prototype.setRegexp = function (regexp) {
|
|
37
109
|
this.regexp = regexp;
|
|
38
110
|
delete this.originFilterText;
|
|
39
111
|
return this;
|
|
40
112
|
};
|
|
113
|
+
/**
|
|
114
|
+
* A function returning a boolean value for if the item passes the filter</br>
|
|
115
|
+
* The function checks the item fields (based on the mapper given when the Filter instance was created) against the filterText argument
|
|
116
|
+
*
|
|
117
|
+
* @param item The item to check
|
|
118
|
+
* @param filterText A string to filter by
|
|
119
|
+
*
|
|
120
|
+
* @return
|
|
121
|
+
*
|
|
122
|
+
* </br>
|
|
123
|
+
*
|
|
124
|
+
* #### <ins>Usage:</ins>
|
|
125
|
+
* ```js
|
|
126
|
+
* const item: T = {name: 'Matan'}
|
|
127
|
+
*
|
|
128
|
+
* //Will print 'true'
|
|
129
|
+
* console.log(filter.filterItem(item, 'Matan'))
|
|
130
|
+
*
|
|
131
|
+
* //Will print 'false'
|
|
132
|
+
* console.log(filter.filterItem(item, 'Adam'))
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
41
135
|
Filter.prototype.filterItem = function (item, filterText) {
|
|
42
136
|
this.prepareFilter(filterText);
|
|
43
137
|
return this.filterImpl(item);
|
|
44
138
|
};
|
|
139
|
+
/**
|
|
140
|
+
* A function returning an array of items that pass the filter</br>
|
|
141
|
+
* The function checks each item's fields (based on the mapper given when the Filter instance was created) against the filterText argument.
|
|
142
|
+
*
|
|
143
|
+
* @param items An array of items to check
|
|
144
|
+
* @param filterText - A string to filter by
|
|
145
|
+
*
|
|
146
|
+
* @return
|
|
147
|
+
*
|
|
148
|
+
* </br>
|
|
149
|
+
*
|
|
150
|
+
* #### <ins>Usage:</ins>
|
|
151
|
+
* ```js
|
|
152
|
+
* //Will return [item2]
|
|
153
|
+
* const filteredItems = filter.filter(items,'Adam');
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
45
156
|
Filter.prototype.filter = function (items, filterText) {
|
|
46
157
|
this.prepareFilter(filterText);
|
|
47
158
|
return items.filter(this.filterImpl);
|
|
48
159
|
};
|
|
160
|
+
/**
|
|
161
|
+
* A function that sets the Filter instance's filter text and regex.
|
|
162
|
+
*
|
|
163
|
+
* @param filter a filter string
|
|
164
|
+
*
|
|
165
|
+
* @returns - the Filter instance
|
|
166
|
+
*
|
|
167
|
+
* #### <ins>Usage:</ins>
|
|
168
|
+
* ```js
|
|
169
|
+
* const filter = new Filter().prepareFilter('REGEX');
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
49
172
|
Filter.prototype.prepareFilter = function (filter) {
|
|
50
173
|
if (this.originFilterText === filter)
|
|
51
|
-
return this
|
|
174
|
+
return this;
|
|
52
175
|
filter = (filter || '').trim();
|
|
53
176
|
filter = filter.toLowerCase();
|
|
54
177
|
filter = filter.replace(/\s+/, ' ');
|
|
@@ -61,6 +184,7 @@ var Filter = /** @class */ (function () {
|
|
|
61
184
|
filter.length === 0 ? filter = '.*?' : filter += '.*';
|
|
62
185
|
this.originFilterText = filter;
|
|
63
186
|
this._filter = new RegExp(filter);
|
|
187
|
+
return this;
|
|
64
188
|
};
|
|
65
189
|
return Filter;
|
|
66
190
|
}());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"filter-tools.js","sourceRoot":"","sources":["../../src/main/utils/filter-tools.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;
|
|
1
|
+
{"version":3,"file":"filter-tools.js","sourceRoot":"","sources":["../../src/main/utils/filter-tools.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAGH;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AACH;IAMC;;;;;;;;;;;;OAYG;IACH,gBAAY,MAA6B;QAAzC,iBAEC;QApBO,WAAM,GAAG,IAAI,CAAC;QA2FtB;;;;;;;;;;;;;;;;;WAiBG;QACH,eAAU,GAAG,UAAC,IAAO;YACpB,IAAM,YAAY,GAAG,KAAI,CAAC,MAAM,CAAC,IAAI,CAAC,CAAC;YACvC,KAAkB,UAAY,EAAZ,6BAAY,EAAZ,0BAAY,EAAZ,IAAY,EAAE;gBAA3B,IAAM,GAAG,qBAAA;gBACb,IAAI,GAAG,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,KAAI,CAAC,OAAO,CAAC;oBACxC,OAAO,IAAI,CAAC;aACb;YAED,OAAO,KAAK,CAAC;QACd,CAAC,CAAC;QAlGD,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACtB,CAAC;IAED;;;;;;;;;;;;;OAaG;IACH,0BAAS,GAAT,UAAU,MAAe;QACxB,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,OAAO,I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IACb,CAAC;IACF,aAAC;AAAD,CAAC,AAtJD,IAsJC;AAtJY,wBAAM"}
|
package/utils/types.d.ts
CHANGED
|
@@ -53,6 +53,7 @@ export declare type DB_Object = DB_BaseObject & {
|
|
|
53
53
|
__created: number;
|
|
54
54
|
__updated: number;
|
|
55
55
|
};
|
|
56
|
+
export declare const KeysToKeepOnDelete: (keyof DB_Object)[];
|
|
56
57
|
export declare type PreDB<T extends DB_Object> = PartialProperties<T, keyof DB_Object>;
|
|
57
58
|
export declare type OmitDBObject<T extends DB_Object> = Omit<T, keyof DB_Object>;
|
|
58
59
|
export declare type Draftable = {
|
|
@@ -85,3 +86,5 @@ export declare type RangeTimestamp = {
|
|
|
85
86
|
min: number;
|
|
86
87
|
max: number;
|
|
87
88
|
};
|
|
89
|
+
export declare type ValidReturnValue = string | number | object;
|
|
90
|
+
export declare type NarrowArray<Default, T1, T2, T3, T4, T5, T6> = T6 extends ValidReturnValue ? [T1, T2, T3, T4, T5, T6] : T5 extends ValidReturnValue ? [T1, T2, T3, T4, T5] : T4 extends ValidReturnValue ? [T1, T2, T3, T4] : T3 extends ValidReturnValue ? [T1, T2, T3] : T2 extends ValidReturnValue ? [T1, T2] : T1 extends ValidReturnValue ? [T1] : Default;
|
package/utils/types.js
CHANGED
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
* limitations under the License.
|
|
18
18
|
*/
|
|
19
19
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
20
|
-
exports.Void = void 0;
|
|
20
|
+
exports.Void = exports.KeysToKeepOnDelete = void 0;
|
|
21
|
+
exports.KeysToKeepOnDelete = ['_id', '_v', '__created', '__updated'];
|
|
21
22
|
exports.Void = (function () {
|
|
22
23
|
})();
|
|
23
24
|
//# sourceMappingURL=types.js.map
|
package/utils/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/main/utils/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/main/utils/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AA4DU,QAAA,kBAAkB,GAAwB,CAAC,KAAK,EAAE,IAAI,EAAE,WAAW,EAAE,WAAW,CAAC,CAAC;AAwBlF,QAAA,IAAI,GAAG,CAAC;AACrB,CAAC,CAAC,EAAE,CAAC"}
|
package/validator/validator.js
CHANGED
|
@@ -211,7 +211,7 @@ var tsValidateObject = function (__validator, instance, path) {
|
|
|
211
211
|
var key = instanceKeys_1[_i];
|
|
212
212
|
// @ts-ignore
|
|
213
213
|
if (!validatorKeys.includes(key))
|
|
214
|
-
throw new exceptions_1.BadImplementationException("
|
|
214
|
+
throw new exceptions_1.BadImplementationException("Unexpected key '".concat(path).concat(key, "'.\nIf you want to ignore the validation of this property,\n add the following to your validator:\n {\n ...\n ").concat(key, ": undefined\n ...\n}\n"));
|
|
215
215
|
}
|
|
216
216
|
for (var _a = 0, validatorKeys_1 = validatorKeys; _a < validatorKeys_1.length; _a++) {
|
|
217
217
|
var key = validatorKeys_1[_a];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validator.js","sourceRoot":"","sources":["../../src/main/validator/validator.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;;;;;;;AAEH,iDAA+E;AAC/E,wCAA4C;AAC5C,sDAA4C;AAE5C,wBAAqC;AA4BrC;IACS,uCAAe;IAIvB,6BAAY,YAAoB,EAAE,IAAY,EAAE,KAAW,EAAE,CAAS;QAAtE,YACC,kBAAM,mBAAmB,EAAE,YAAY,EAAE,CAAC,CAAC,SAG3C;QAFA,KAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,KAAI,CAAC,KAAK,GAAG,KAAK,CAAC;;IACpB,CAAC;IACF,0BAAC;AAAD,CAAC,AAVD,CACS,4BAAe,GASvB;AAVY,kDAAmB;AA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