@nu-art/ts-common 0.105.0 → 0.105.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.
Files changed (148) hide show
  1. package/consts/consts.d.ts +1 -0
  2. package/consts/consts.js +22 -0
  3. package/consts/consts.js.map +1 -0
  4. package/core/application.d.ts +5 -0
  5. package/core/application.js +55 -0
  6. package/core/application.js.map +1 -0
  7. package/core/debug-flags.d.ts +25 -0
  8. package/core/debug-flags.js +87 -0
  9. package/core/debug-flags.js.map +1 -0
  10. package/core/dispatcher.d.ts +18 -0
  11. package/core/dispatcher.js +132 -0
  12. package/core/dispatcher.js.map +1 -0
  13. package/core/error-handling.d.ts +14 -0
  14. package/core/error-handling.js +38 -0
  15. package/core/error-handling.js.map +1 -0
  16. package/core/exceptions.d.ts +118 -0
  17. package/core/exceptions.js +214 -0
  18. package/core/exceptions.js.map +1 -0
  19. package/core/logger/BeLogged.d.ts +14 -0
  20. package/core/logger/BeLogged.js +61 -0
  21. package/core/logger/BeLogged.js.map +1 -0
  22. package/core/logger/LogClient.d.ts +14 -0
  23. package/core/logger/LogClient.js +67 -0
  24. package/core/logger/LogClient.js.map +1 -0
  25. package/core/logger/LogClient_BaseRotate.d.ts +19 -0
  26. package/core/logger/LogClient_BaseRotate.js +80 -0
  27. package/core/logger/LogClient_BaseRotate.js.map +1 -0
  28. package/core/logger/LogClient_Browser.d.ts +9 -0
  29. package/core/logger/LogClient_Browser.js +101 -0
  30. package/core/logger/LogClient_Browser.js.map +1 -0
  31. package/core/logger/LogClient_Function.d.ts +8 -0
  32. package/core/logger/LogClient_Function.js +75 -0
  33. package/core/logger/LogClient_Function.js.map +1 -0
  34. package/core/logger/LogClient_MemBuffer.d.ts +9 -0
  35. package/core/logger/LogClient_MemBuffer.js +61 -0
  36. package/core/logger/LogClient_MemBuffer.js.map +1 -0
  37. package/core/logger/LogClient_Terminal.d.ts +9 -0
  38. package/core/logger/LogClient_Terminal.js +75 -0
  39. package/core/logger/LogClient_Terminal.js.map +1 -0
  40. package/core/logger/Logger.d.ts +38 -0
  41. package/core/logger/Logger.js +216 -0
  42. package/core/logger/Logger.js.map +1 -0
  43. package/core/logger/types.d.ts +10 -0
  44. package/core/logger/types.js +36 -0
  45. package/core/logger/types.js.map +1 -0
  46. package/core/logger/utils.d.ts +5 -0
  47. package/core/logger/utils.js +80 -0
  48. package/core/logger/utils.js.map +1 -0
  49. package/core/module-manager.d.ts +18 -0
  50. package/core/module-manager.js +112 -0
  51. package/core/module-manager.js.map +1 -0
  52. package/core/module.d.ts +32 -0
  53. package/core/module.js +126 -0
  54. package/core/module.js.map +1 -0
  55. package/csv.d.ts +1 -0
  56. package/csv.js +35 -0
  57. package/csv.js.map +1 -0
  58. package/index.d.ts +43 -0
  59. package/index.js +77 -0
  60. package/index.js.map +1 -0
  61. package/modules/CSVModule.d.ts +32 -0
  62. package/modules/CSVModule.js +165 -0
  63. package/modules/CSVModule.js.map +1 -0
  64. package/modules/CliParamsModule.d.ts +27 -0
  65. package/modules/CliParamsModule.js +94 -0
  66. package/modules/CliParamsModule.js.map +1 -0
  67. package/modules/csv-serializer.d.ts +11 -0
  68. package/modules/csv-serializer.js +50 -0
  69. package/modules/csv-serializer.js.map +1 -0
  70. package/package.json +3 -6
  71. package/permissions/permission-group.d.ts +8 -0
  72. package/permissions/permission-group.js +37 -0
  73. package/permissions/permission-group.js.map +1 -0
  74. package/test-index.d.ts +2 -0
  75. package/test-index.js +19 -0
  76. package/test-index.js.map +1 -0
  77. package/testing/consts.d.ts +5 -0
  78. package/testing/consts.js +74 -0
  79. package/testing/consts.js.map +1 -0
  80. package/testing/types.d.ts +16 -0
  81. package/testing/types.js +20 -0
  82. package/testing/types.js.map +1 -0
  83. package/tools/Replacer.d.ts +24 -0
  84. package/tools/Replacer.js +172 -0
  85. package/tools/Replacer.js.map +1 -0
  86. package/tools/get-log-style.d.ts +14 -0
  87. package/tools/get-log-style.js +43 -0
  88. package/tools/get-log-style.js.map +1 -0
  89. package/utils/array-tools.d.ts +85 -0
  90. package/utils/array-tools.js +302 -0
  91. package/utils/array-tools.js.map +1 -0
  92. package/utils/crypto-tools.d.ts +4 -0
  93. package/utils/crypto-tools.js +36 -0
  94. package/utils/crypto-tools.js.map +1 -0
  95. package/utils/date-time-tools.d.ts +28 -0
  96. package/utils/date-time-tools.js +180 -0
  97. package/utils/date-time-tools.js.map +1 -0
  98. package/utils/db-object-tools.d.ts +3 -0
  99. package/utils/db-object-tools.js +9 -0
  100. package/utils/db-object-tools.js.map +1 -0
  101. package/utils/filter-tools.d.ts +137 -0
  102. package/utils/filter-tools.js +217 -0
  103. package/utils/filter-tools.js.map +1 -0
  104. package/utils/hash-tools.d.ts +8 -0
  105. package/utils/hash-tools.js +60 -0
  106. package/utils/hash-tools.js.map +1 -0
  107. package/utils/merge-tools.d.ts +3 -0
  108. package/utils/merge-tools.js +71 -0
  109. package/utils/merge-tools.js.map +1 -0
  110. package/utils/mimetype-tools.d.ts +8 -0
  111. package/utils/mimetype-tools.js +29 -0
  112. package/utils/mimetype-tools.js.map +1 -0
  113. package/utils/number-tools.d.ts +1 -0
  114. package/utils/number-tools.js +26 -0
  115. package/utils/number-tools.js.map +1 -0
  116. package/utils/object-tools.d.ts +13 -0
  117. package/utils/object-tools.js +129 -0
  118. package/utils/object-tools.js.map +1 -0
  119. package/utils/query-params.d.ts +5 -0
  120. package/utils/query-params.js +24 -0
  121. package/utils/query-params.js.map +1 -0
  122. package/utils/queue.d.ts +16 -0
  123. package/utils/queue.js +166 -0
  124. package/utils/queue.js.map +1 -0
  125. package/utils/random-tools.d.ts +2 -0
  126. package/utils/random-tools.js +35 -0
  127. package/utils/random-tools.js.map +1 -0
  128. package/utils/storage-capacity-tools.d.ts +6 -0
  129. package/utils/storage-capacity-tools.js +27 -0
  130. package/utils/storage-capacity-tools.js.map +1 -0
  131. package/utils/string-tools.d.ts +10 -0
  132. package/utils/string-tools.js +100 -0
  133. package/utils/string-tools.js.map +1 -0
  134. package/utils/tools.d.ts +13 -0
  135. package/utils/tools.js +103 -0
  136. package/utils/tools.js.map +1 -0
  137. package/utils/types.d.ts +92 -0
  138. package/utils/types.js +23 -0
  139. package/utils/types.js.map +1 -0
  140. package/utils/version-tools.d.ts +10 -0
  141. package/utils/version-tools.js +51 -0
  142. package/utils/version-tools.js.map +1 -0
  143. package/validator/type-validators.d.ts +29 -0
  144. package/validator/type-validators.js +211 -0
  145. package/validator/type-validators.js.map +1 -0
  146. package/validator/validator-core.d.ts +36 -0
  147. package/validator/validator-core.js +144 -0
  148. package/validator/validator-core.js.map +1 -0
@@ -0,0 +1,6 @@
1
+ export declare const Byte = 1;
2
+ export declare const KB: number;
3
+ export declare const MB: number;
4
+ export declare const GB: number;
5
+ export declare const TB: number;
6
+ export declare const PB: number;
@@ -0,0 +1,27 @@
1
+ "use strict";
2
+ /*
3
+ * ts-common is the basic building blocks of our typescript projects
4
+ *
5
+ * Copyright (C) 2020 Adam van der Kruk aka TacB0sS
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.PB = exports.TB = exports.GB = exports.MB = exports.KB = exports.Byte = void 0;
21
+ exports.Byte = 1;
22
+ exports.KB = exports.Byte * 1024;
23
+ exports.MB = exports.KB * 1024;
24
+ exports.GB = exports.MB * 1024;
25
+ exports.TB = exports.GB * 1024;
26
+ exports.PB = exports.TB * 1024;
27
+ //# sourceMappingURL=storage-capacity-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"storage-capacity-tools.js","sourceRoot":"","sources":["../../src/main/utils/storage-capacity-tools.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEU,QAAA,IAAI,GAAG,CAAC,CAAC;AACT,QAAA,EAAE,GAAG,YAAI,GAAG,IAAI,CAAC;AACjB,QAAA,EAAE,GAAG,UAAE,GAAG,IAAI,CAAC;AACf,QAAA,EAAE,GAAG,UAAE,GAAG,IAAI,CAAC;AACf,QAAA,EAAE,GAAG,UAAE,GAAG,IAAI,CAAC;AACf,QAAA,EAAE,GAAG,UAAE,GAAG,IAAI,CAAC"}
@@ -0,0 +1,10 @@
1
+ export declare function padNumber(num: number | string, length: number): string;
2
+ export declare function stringToHashCode(stringToHash: string): number;
3
+ export declare function escape_RegExp(string: string): string;
4
+ export declare function stringFormat(input: string, params?: string[]): string;
5
+ export declare function replaceStringAt(origin: string, index: number, replacement: string): string;
6
+ export declare function capitalizeAllFirstLetters(value: string): string;
7
+ export declare function capitalizeFirstLetter(value: string): string;
8
+ export declare function createLevenshteinDistanceMatrix(str1: string, str2: string): number[][];
9
+ export declare function levenshteinDistance(str1: string, str2: string): number;
10
+ export declare function normalizeString(string: string): string;
@@ -0,0 +1,100 @@
1
+ "use strict";
2
+ /*
3
+ * ts-common is the basic building blocks of our typescript projects
4
+ *
5
+ * Copyright (C) 2020 Adam van der Kruk aka TacB0sS
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.normalizeString = exports.levenshteinDistance = exports.createLevenshteinDistanceMatrix = exports.capitalizeFirstLetter = exports.capitalizeAllFirstLetters = exports.replaceStringAt = exports.stringFormat = exports.escape_RegExp = exports.stringToHashCode = exports.padNumber = void 0;
21
+ function padNumber(num, length) {
22
+ var _num = num.toString();
23
+ return _num.length < length ? padNumber('0' + _num, length) : _num;
24
+ }
25
+ exports.padNumber = padNumber;
26
+ function stringToHashCode(stringToHash) {
27
+ var hash = 0;
28
+ if (stringToHash.length === 0)
29
+ return hash;
30
+ for (var i = 0; i < stringToHash.length; i++) {
31
+ hash = ((hash << 5) - hash) + stringToHash.charCodeAt(i);
32
+ hash = hash & hash; // Convert to 32bit integer
33
+ }
34
+ return hash;
35
+ }
36
+ exports.stringToHashCode = stringToHashCode;
37
+ function escape_RegExp(string) {
38
+ return string.replace(/[.*+?^${}()|[\]\\]/g, '\\$&'); // $& means the whole matched string
39
+ }
40
+ exports.escape_RegExp = escape_RegExp;
41
+ function stringFormat(input, params) {
42
+ if (params === void 0) { params = []; }
43
+ return (params === null || params === void 0 ? void 0 : params.reduce(function (toRet, param, index) {
44
+ return toRet.replace(new RegExp("\\{".concat(index, "\\}"), 'g'), param);
45
+ }, input || '')) || input;
46
+ }
47
+ exports.stringFormat = stringFormat;
48
+ function replaceStringAt(origin, index, replacement) {
49
+ if (!(origin === null || origin === void 0 ? void 0 : origin.length) || !(replacement === null || replacement === void 0 ? void 0 : replacement.length))
50
+ return origin;
51
+ return origin.substring(0, index) + replacement + origin.substring(index + replacement.length);
52
+ }
53
+ exports.replaceStringAt = replaceStringAt;
54
+ function capitalizeAllFirstLetters(value) {
55
+ var resultString = value;
56
+ for (var i = 0; i < resultString.length; i++) {
57
+ if (i === 0 || i > 0 && resultString[i - 1] === ' ')
58
+ resultString = replaceStringAt(resultString, i, resultString[i].toUpperCase());
59
+ }
60
+ return resultString;
61
+ }
62
+ exports.capitalizeAllFirstLetters = capitalizeAllFirstLetters;
63
+ function capitalizeFirstLetter(value) {
64
+ return value.charAt(0).toUpperCase() + value.substr(1).toLowerCase();
65
+ }
66
+ exports.capitalizeFirstLetter = capitalizeFirstLetter;
67
+ function createLevenshteinDistanceMatrix(str1, str2) {
68
+ var len1 = str1.length;
69
+ var len2 = str2.length;
70
+ //Init 2D matrix of size str1.length * str2.length filled with 0
71
+ var matrix = Array.from({ length: len1 + 1 }).map(function () { return Array.from({ length: len2 + 1 }).fill(0); });
72
+ //Fill first column and first row with the positions of the chars
73
+ for (var i = 0; i <= len1; i++)
74
+ matrix[i][0] = i;
75
+ for (var i = 0; i <= len2; i++)
76
+ matrix[0][i] = i;
77
+ //Fill each cell in matrix with the cost of aligning the two chars based on previous actions in the matrix
78
+ for (var j = 1; j <= len2; j++)
79
+ for (var i = 1; i <= len1; i++)
80
+ matrix[i][j] = Math.min((matrix[i - 1][j]) + 1, (matrix[i][j - 1]) + 1, (matrix[i - 1][j - 1]) + (str1[i - 1] === str2[j - 1] ? 0 : 1));
81
+ return matrix;
82
+ }
83
+ exports.createLevenshteinDistanceMatrix = createLevenshteinDistanceMatrix;
84
+ function levenshteinDistance(str1, str2) {
85
+ //Quick exists
86
+ if (str1.length === 0)
87
+ return str2.length;
88
+ if (str2.length === 0)
89
+ return str1.length;
90
+ //Get levenshtein distance matrix
91
+ var matrix = createLevenshteinDistanceMatrix(str1, str2);
92
+ //Distance between the strings should be at bottom right corner of the matrix
93
+ return matrix[str1.length][str2.length];
94
+ }
95
+ exports.levenshteinDistance = levenshteinDistance;
96
+ function normalizeString(string) {
97
+ return string.replace(/–/g, '-').replace(/\n/g, '').replace(/\s+/g, ' ').replace(/’/g, '\'').trim();
98
+ }
99
+ exports.normalizeString = normalizeString;
100
+ //# sourceMappingURL=string-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"string-tools.js","sourceRoot":"","sources":["../../src/main/utils/string-tools.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAEH,SAAgB,SAAS,CAAC,GAAoB,EAAE,MAAc;IAC7D,IAAM,IAAI,GAAG,GAAG,CAAC,Q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CAAC;QAAE,OAAO,IAAI,CAAC,MAAM,CAAC;IAC1C,IAAI,IAAI,CAAC,MAAM,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC,MAAM,CAAC;IAE1C,iCAAiC;IACjC,IAAM,MAAM,GAAG,+BAA+B,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC;IAE3D,6EAA6E;IAC7E,OAAO,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC;AACzC,CAAC;AAVD,kDAUC;AAED,SAAgB,eAAe,CAAC,MAAc;IAC7C,OAAO,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,IAAI,CAAC,CAAC,IAAI,EAAE,CAAC;AACrG,CAAC;AAFD,0CAEC"}
@@ -0,0 +1,13 @@
1
+ import { TS_Object } from './types';
2
+ export declare function regexpCase(value: string, reg: string): RegExpMatchArray | {
3
+ input: undefined;
4
+ };
5
+ export declare function createFilterPattern(rawFilter?: string): string;
6
+ export declare function calculateJsonSizeMb(data: TS_Object): number;
7
+ export declare function __stringify<T extends object | string>(obj?: T, pretty?: boolean | (keyof T)[]): string;
8
+ export declare const EmptyObject: Readonly<{}>;
9
+ export declare const EmptyArray: readonly never[];
10
+ export declare const voidFunction: () => Promise<void>;
11
+ export declare const functionThatReturnsFalse: () => false;
12
+ export declare const functionThatReturnsTrue: () => true;
13
+ export declare function exists(item: any): boolean;
package/utils/tools.js ADDED
@@ -0,0 +1,103 @@
1
+ "use strict";
2
+ /*
3
+ * ts-common is the basic building blocks of our typescript projects
4
+ *
5
+ * Copyright (C) 2020 Adam van der Kruk aka TacB0sS
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
20
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
21
+ return new (P || (P = Promise))(function (resolve, reject) {
22
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
23
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
24
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
25
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
26
+ });
27
+ };
28
+ var __generator = (this && this.__generator) || function (thisArg, body) {
29
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
30
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
31
+ function verb(n) { return function (v) { return step([n, v]); }; }
32
+ function step(op) {
33
+ if (f) throw new TypeError("Generator is already executing.");
34
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
35
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
36
+ if (y = 0, t) op = [op[0] & 2, t.value];
37
+ switch (op[0]) {
38
+ case 0: case 1: t = op; break;
39
+ case 4: _.label++; return { value: op[1], done: false };
40
+ case 5: _.label++; y = op[1]; op = [0]; continue;
41
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
42
+ default:
43
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
44
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
45
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
46
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
47
+ if (t[2]) _.ops.pop();
48
+ _.trys.pop(); continue;
49
+ }
50
+ op = body.call(thisArg, _);
51
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
52
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
53
+ }
54
+ };
55
+ Object.defineProperty(exports, "__esModule", { value: true });
56
+ exports.exists = exports.functionThatReturnsTrue = exports.functionThatReturnsFalse = exports.voidFunction = exports.EmptyArray = exports.EmptyObject = exports.__stringify = exports.calculateJsonSizeMb = exports.createFilterPattern = exports.regexpCase = void 0;
57
+ var object_tools_1 = require("./object-tools");
58
+ function regexpCase(value, reg) {
59
+ return value.match(new RegExp(reg)) || { input: undefined };
60
+ }
61
+ exports.regexpCase = regexpCase;
62
+ function createFilterPattern(rawFilter) {
63
+ var filter = rawFilter || '';
64
+ filter = filter.trim();
65
+ filter = filter.replace(/\s+/, ' ');
66
+ filter = filter.replace(new RegExp('(.)', 'g'), '.*?$1');
67
+ filter.length === 0 ? filter = '.*?' : filter += '.*';
68
+ return filter;
69
+ }
70
+ exports.createFilterPattern = createFilterPattern;
71
+ function calculateJsonSizeMb(data) {
72
+ var number = JSON.stringify(data).length / 1024 / 1024;
73
+ return Math.round(number * 100) / 100;
74
+ }
75
+ exports.calculateJsonSizeMb = calculateJsonSizeMb;
76
+ function __stringify(obj, pretty) {
77
+ if (!obj)
78
+ return '';
79
+ if (typeof obj === 'string')
80
+ return obj;
81
+ if (Array.isArray(pretty))
82
+ return "".concat((0, object_tools_1._keys)(obj).reduce(function (carry, key, idx) {
83
+ return carry + " ".concat(String(key), ": ").concat(__stringify(obj[key], pretty.includes(key))).concat(idx !== (0, object_tools_1._keys)(obj).length - 1 && ',\n');
84
+ }, "{\n"), "\n}");
85
+ if (pretty)
86
+ return JSON.stringify(obj, null, 2);
87
+ return JSON.stringify(obj);
88
+ }
89
+ exports.__stringify = __stringify;
90
+ exports.EmptyObject = Object.freeze({});
91
+ exports.EmptyArray = Object.freeze([]);
92
+ exports.voidFunction = Object.freeze(function () { return __awaiter(void 0, void 0, void 0, function () {
93
+ return __generator(this, function (_a) {
94
+ return [2 /*return*/];
95
+ });
96
+ }); });
97
+ exports.functionThatReturnsFalse = Object.freeze(function () { return false; });
98
+ exports.functionThatReturnsTrue = Object.freeze(function () { return true; });
99
+ function exists(item) {
100
+ return item !== undefined && item !== null;
101
+ }
102
+ exports.exists = exists;
103
+ //# sourceMappingURL=tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tools.js","sourceRoot":"","sources":["../../src/main/utils/tools.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,+CAAqC;AAIrC,SAAgB,UAAU,CAAC,KAAa,EAAE,GAAW;IACpD,OAAO,KAAK,CAAC,KAAK,CAAC,IAAI,MAAM,CAAC,GAAG,CAAC,CAAC,IAAI,EAAC,KAAK,EAAE,SAAS,EAAC,CAAC;AAC3D,CAAC;AAFD,gCAEC;AAED,SAAgB,mBAAmB,CAAC,SAAkB;IACrD,IAAI,MAAM,GAAG,SAAS,IAAI,EAAE,CAAC;IAC7B,MAAM,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;IACvB,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,KAAK,EAAE,GAAG,CAAC,CAAC;IACpC,MAAM,GAAG,MAAM,CAAC,OAAO,CAAC,IAAI,MAAM,CAAC,KAAK,EAAE,GAAG,CAAC,EAAE,OAAO,CAAC,CAAC;IACzD,MAAM,CAAC,MAAM,KAAK,CAAC,CAAC,CAAC,CAAC,MAAM,GAAG,KAAK,CAAC,CAAC,CAAC,MA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AY,GAAG,MAAM,CAAC,MAAM,CAAC;;;;KACzC,CAAC,CAAC;AAEU,QAAA,wBAAwB,GAAG,MAAM,CAAC,MAAM,CAAC,cAAM,OAAA,KAAK,EAAL,CAAK,CAAC,CAAC;AACtD,QAAA,uBAAuB,GAAG,MAAM,CAAC,MAAM,CAAC,cAAM,OAAA,IAAI,EAAJ,CAAI,CAAC,CAAC;AAGjE,SAAgB,MAAM,CAAC,IAAS;IAC/B,OAAO,IAAI,KAAK,SAAS,IAAI,IAAI,KAAK,IAAI,CAAC;AAC5C,CAAC;AAFD,wBAEC"}
@@ -0,0 +1,92 @@
1
+ export type CustomOptional<T, K> = {
2
+ [P in keyof T]?: K;
3
+ };
4
+ export type Subset<T> = {
5
+ [P in keyof T]: T[P];
6
+ };
7
+ export type OptionalKeys<T extends TS_Object> = Exclude<{
8
+ [K in keyof T]: T extends Record<K, T[K]> ? never : K;
9
+ }[keyof T], undefined>;
10
+ export type MandatoryKeys<T extends TS_Object, V extends any = any> = Exclude<{
11
+ [K in keyof T]: T extends Record<K, T[K]> ? (T[K] extends V ? K : never) : never;
12
+ }[keyof T], undefined>;
13
+ export type RequireOptionals<T extends TS_Object, Keys extends OptionalKeys<T> = OptionalKeys<T>> = Pick<T, Exclude<keyof T, Keys>> & {
14
+ [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
15
+ }[Keys];
16
+ export type RequireOneOptional<T extends TS_Object, Keys extends OptionalKeys<T> = OptionalKeys<T>> = Pick<T, Exclude<keyof T, Keys>> & {
17
+ [K in Keys]-?: Required<Pick<T, K>> & Partial<Record<Exclude<Keys, K>, undefined>>;
18
+ }[Keys];
19
+ export type RequireAtLeastOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
20
+ [K in Keys]-?: Required<Pick<T, K>> & Partial<Pick<T, Exclude<Keys, K>>>;
21
+ }[Keys];
22
+ export type RequireOnlyOne<T, Keys extends keyof T = keyof T> = Pick<T, Exclude<keyof T, Keys>> & {
23
+ [K in Keys]-?: Required<Pick<T, K>> & Partial<Record<Exclude<Keys, K>, undefined>>;
24
+ }[Keys];
25
+ export type Constructor<T> = new (...args: any) => T;
26
+ export type ArrayType<T extends any[]> = T extends (infer I)[] ? I : never;
27
+ export type NestedArrayType<T extends any[]> = T extends (infer I)[] ? I extends any[] ? NestedArrayType<I> : I : never;
28
+ export type PartialProperties<T, K extends keyof T> = Omit<T, K> & Partial<Pick<T, K>>;
29
+ export type KeyValue = TypedKeyValue<string, string>;
30
+ export type TypedKeyValue<KeyType, ValueType> = {
31
+ key: KeyType;
32
+ value: ValueType;
33
+ };
34
+ export type Identity = {
35
+ id: string;
36
+ };
37
+ export type StringMap = {
38
+ [s: string]: string;
39
+ };
40
+ export type TS_Object = {
41
+ [s: string]: any;
42
+ };
43
+ export type TypedMap<ValueType> = {
44
+ [s: string]: ValueType;
45
+ };
46
+ export type TypedMapValue<T extends TS_Object, ValueType> = {
47
+ [P in keyof T]: ValueType;
48
+ };
49
+ export type AtLeast<T, K extends keyof T> = Partial<T> & Pick<T, K>;
50
+ export type DB_BaseObject = {
51
+ _id: string;
52
+ };
53
+ export type DB_Object = DB_BaseObject & {
54
+ _v?: string;
55
+ __created: number;
56
+ __updated: number;
57
+ };
58
+ export type UniqueId = string;
59
+ export type PreDB<T extends DB_Object> = PartialProperties<T, keyof DB_Object>;
60
+ export type OmitDBObject<T extends DB_Object> = Omit<T, keyof DB_Object>;
61
+ export type Draftable = {
62
+ _isDraft: boolean;
63
+ };
64
+ export type Auditable = {
65
+ _audit?: AuditBy;
66
+ };
67
+ export type AuditBy = {
68
+ comment?: string;
69
+ auditBy: string;
70
+ auditAt: Timestamp;
71
+ };
72
+ export type Timestamp = {
73
+ timestamp: number;
74
+ pretty: string;
75
+ timezone?: string;
76
+ };
77
+ export type FunctionKeys<T> = {
78
+ [K in keyof T]: T[K] extends (...args: any) => any ? K : never;
79
+ }[keyof T];
80
+ export declare const Void: void;
81
+ export type PackageJson = {
82
+ version: string;
83
+ name: string;
84
+ };
85
+ export type DeflatePromise<T> = T extends Promise<infer A> ? A : T;
86
+ export type ReturnPromiseType<T extends (...args: any) => any> = T extends (...args: any) => infer R ? DeflatePromise<R> : never;
87
+ export type RangeTimestamp = {
88
+ min: number;
89
+ max: number;
90
+ };
91
+ export type ValidReturnValue = string | number | object;
92
+ export 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 ADDED
@@ -0,0 +1,23 @@
1
+ "use strict";
2
+ /*
3
+ * ts-common is the basic building blocks of our typescript projects
4
+ *
5
+ * Copyright (C) 2020 Adam van der Kruk aka TacB0sS
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.Void = void 0;
21
+ exports.Void = (function () {
22
+ })();
23
+ //# sourceMappingURL=types.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/main/utils/types.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAyFU,QAAA,IAAI,GAAG,CAAC;AACrB,CAAC,CAAC,EAAE,CAAC"}
@@ -0,0 +1,10 @@
1
+ /**
2
+ *
3
+ * @param firstVersion a version
4
+ * @param secondVersion another version
5
+ *
6
+ * @return -1 if first is greater
7
+ * 0 if versions match
8
+ * 1 if second is greater
9
+ */
10
+ export declare function compareVersions(firstVersion: string, secondVersion: string): 0 | 1 | -1;
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ /*
3
+ * ts-common is the basic building blocks of our typescript projects
4
+ *
5
+ * Copyright (C) 2020 Adam van der Kruk aka TacB0sS
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+ Object.defineProperty(exports, "__esModule", { value: true });
20
+ exports.compareVersions = void 0;
21
+ var index_1 = require("../index");
22
+ /**
23
+ *
24
+ * @param firstVersion a version
25
+ * @param secondVersion another version
26
+ *
27
+ * @return -1 if first is greater
28
+ * 0 if versions match
29
+ * 1 if second is greater
30
+ */
31
+ function compareVersions(firstVersion, secondVersion) {
32
+ if (!firstVersion)
33
+ throw new index_1.BadImplementationException("First version is undefined");
34
+ if (!secondVersion)
35
+ throw new index_1.BadImplementationException("Second version is undefined");
36
+ var firstVersionAsArray = firstVersion.split("\.");
37
+ var secondVersionAsArray = secondVersion.split("\.");
38
+ for (var i = 0; i < firstVersionAsArray.length; i++) {
39
+ var secondVal = +secondVersionAsArray[i];
40
+ var firstVal = +firstVersionAsArray[i];
41
+ if (secondVal > firstVal)
42
+ return 1;
43
+ if (secondVal === firstVal)
44
+ continue;
45
+ if (secondVal < firstVal)
46
+ return -1;
47
+ }
48
+ return 0;
49
+ }
50
+ exports.compareVersions = compareVersions;
51
+ //# sourceMappingURL=version-tools.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"version-tools.js","sourceRoot":"","sources":["../../src/main/utils/version-tools.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;;;GAgBG;;;AAGH,kCAAoD;AAEpD;;;;;;;;GAQG;AACH,SAAgB,eAAe,CAAC,YAAoB,EAAE,aAAqB;IAC1E,IAAI,CAAC,YAAY;QAChB,MAAM,IAAI,kCAA0B,CAAC,4BAA4B,CAAC,CAAC;IAEpE,IAAI,CAAC,aAAa;QACjB,MAAM,IAAI,kCAA0B,CAAC,6BAA6B,CAAC,CAAC;IAErE,IAAM,mBAAmB,GAAG,YAAY,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACrD,IAAM,oBAAoB,GAAG,aAAa,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACvD,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,mBAAmB,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;QACpD,IAAM,SAAS,GAAG,CAAC,oBAAoB,CAAC,CAAC,CAAC,CAAC;QAC3C,IAAM,QAAQ,GAAG,CAAC,mBAAmB,CAAC,CAAC,CAAC,CAAC;QACzC,IAAI,SAAS,GAAG,QAAQ;YACvB,OAAO,CAAC,CAAC;QAEV,IAAI,SAAS,KAAK,QAAQ;YACzB,SAAS;QAEV,IAAI,SAAS,GAAG,QAAQ;YACvB,OAAO,CAAC,CAAC,CAAC;KACX;IAED,OAAO,CAAC,CAAC;AACV,CAAC;AAvBD,0CAuBC"}
@@ -0,0 +1,29 @@
1
+ import { InvalidResult, InvalidResultObject, Validator, ValidatorTypeResolver } from './validator-core';
2
+ import { ArrayType, AuditBy, RangeTimestamp, TypedMap } from '../utils/types';
3
+ export declare const tsValidateDynamicObject: <T extends object>(valuesValidator: ValidatorTypeResolver<T[keyof T]>, keysValidator: ValidatorTypeResolver<string>, mandatory?: boolean) => (import("./validator-core").ValidatorImpl<any> | ((input?: T | undefined) => InvalidResultObject<T> | undefined))[];
4
+ export declare const tsValidateUnion: <T extends unknown>(validators: ValidatorTypeResolver<T>[], mandatory?: boolean) => import("./validator-core").ValidatorImpl<any>[];
5
+ export declare const tsValidateCustom: <T extends unknown>(processor: (input?: T | undefined, parentInput?: any) => InvalidResult<T>, mandatory?: boolean) => Validator<T>[];
6
+ declare const typeFunc: (type: any) => "string" | "number" | "bigint" | "boolean" | "symbol" | "undefined" | "object" | "function";
7
+ type types = ReturnType<typeof typeFunc>;
8
+ type validatorObject<T> = {
9
+ [k in types]?: ValidatorTypeResolver<T>;
10
+ };
11
+ export declare const tsValidateUnionV3: <T extends unknown>(validatorObject: validatorObject<T>, mandatory?: boolean) => ((input?: T | undefined) => any)[];
12
+ export declare const tsValidateArray: <T extends any[], I extends ArrayType<T> = ArrayType<T>>(validator: ValidatorTypeResolver<I>, mandatory?: boolean, minimumLength?: number) => Validator<I[]>;
13
+ export declare const tsValidateString: (length?: number, mandatory?: boolean) => Validator<string>;
14
+ export declare const tsValidator_nonMandatoryString: Validator<string>;
15
+ export declare const tsValidateNumber: (mandatory?: boolean) => Validator<number>;
16
+ export declare const tsValidateEnum: (enumType: TypedMap<number | string>, mandatory?: boolean) => Validator<number | string>;
17
+ export declare const tsValidateBoolean: (mandatory?: boolean) => Validator<boolean>;
18
+ export declare const tsValidateValue: (values: string[], mandatory?: boolean) => Validator<string>;
19
+ export declare const tsValidateIsInRange: (ranges: [number, number][], mandatory?: boolean) => Validator<number>;
20
+ export declare const tsValidateRange: (mandatory?: boolean) => Validator<[number, number] | undefined>;
21
+ export declare const tsValidateRegexp: (regexp: RegExp, mandatory?: boolean) => Validator<string>;
22
+ export declare const tsValidateMD5: (mandatory?: boolean) => Validator<string>;
23
+ export declare const tsValidateTimestamp: (interval?: number, mandatory?: boolean) => Validator<number>;
24
+ export declare const tsValidateAudit: (range?: RangeTimestamp) => (audit?: AuditBy) => any;
25
+ export declare const tsValidateNonMandatoryObject: <T>(validator: ValidatorTypeResolver<T>) => ((input?: T | undefined) => any)[];
26
+ export declare const tsValidator_color: {
27
+ value: Validator<string>;
28
+ };
29
+ export {};