topkat-utils 1.1.13 → 1.1.14

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 (76) hide show
  1. package/dist/index.d.ts +36 -0
  2. package/dist/index.js +58 -0
  3. package/dist/index.js.map +1 -0
  4. package/dist/src/array-utils.d.ts +56 -0
  5. package/dist/src/array-utils.js +160 -0
  6. package/dist/src/array-utils.js.map +1 -0
  7. package/dist/src/config.d.ts +44 -0
  8. package/dist/src/config.js +66 -0
  9. package/dist/src/config.js.map +1 -0
  10. package/dist/src/date-utils.d.ts +100 -0
  11. package/dist/src/date-utils.js +407 -0
  12. package/dist/src/date-utils.js.map +1 -0
  13. package/dist/src/env-utils.d.ts +8 -0
  14. package/dist/src/env-utils.js +38 -0
  15. package/dist/src/env-utils.js.map +1 -0
  16. package/dist/src/error-utils.d.ts +8 -0
  17. package/dist/src/error-utils.js +135 -0
  18. package/dist/src/error-utils.js.map +1 -0
  19. package/dist/src/is-empty.d.ts +1 -0
  20. package/dist/src/is-empty.js +13 -0
  21. package/dist/src/is-empty.js.map +1 -0
  22. package/dist/src/is-object.d.ts +2 -0
  23. package/dist/src/is-object.js +7 -0
  24. package/dist/src/is-object.js.map +1 -0
  25. package/dist/src/isset.d.ts +1 -0
  26. package/dist/src/isset.js +12 -0
  27. package/dist/src/isset.js.map +1 -0
  28. package/dist/src/logger-utils.d.ts +76 -0
  29. package/dist/src/logger-utils.js +484 -0
  30. package/dist/src/logger-utils.js.map +1 -0
  31. package/dist/src/loop-utils.d.ts +40 -0
  32. package/dist/src/loop-utils.js +182 -0
  33. package/dist/src/loop-utils.js.map +1 -0
  34. package/dist/src/math-utils.d.ts +23 -0
  35. package/dist/src/math-utils.js +59 -0
  36. package/dist/src/math-utils.js.map +1 -0
  37. package/dist/src/mongo-utils.d.ts +11 -0
  38. package/dist/src/mongo-utils.js +63 -0
  39. package/dist/src/mongo-utils.js.map +1 -0
  40. package/dist/src/object-utils.d.ts +96 -0
  41. package/dist/src/object-utils.js +409 -0
  42. package/dist/src/object-utils.js.map +1 -0
  43. package/dist/src/private/config.d.ts +44 -0
  44. package/dist/src/private/config.js +66 -0
  45. package/dist/src/private/config.js.map +1 -0
  46. package/dist/src/private/error-handler.d.ts +10 -0
  47. package/dist/src/private/error-handler.js +46 -0
  48. package/dist/src/private/error-handler.js.map +1 -0
  49. package/dist/src/private/types.d.ts +5 -0
  50. package/dist/src/private/types.js +3 -0
  51. package/dist/src/private/types.js.map +1 -0
  52. package/dist/src/regexp-utils.d.ts +12 -0
  53. package/dist/src/regexp-utils.js +45 -0
  54. package/dist/src/regexp-utils.js.map +1 -0
  55. package/dist/src/remove-circular-json-stringify.d.ts +1 -0
  56. package/dist/src/remove-circular-json-stringify.js +21 -0
  57. package/dist/src/remove-circular-json-stringify.js.map +1 -0
  58. package/dist/src/string-utils.d.ts +77 -0
  59. package/dist/src/string-utils.js +267 -0
  60. package/dist/src/string-utils.js.map +1 -0
  61. package/dist/src/tests-utils.d.ts +21 -0
  62. package/dist/src/tests-utils.js +80 -0
  63. package/dist/src/tests-utils.js.map +1 -0
  64. package/dist/src/timer-utils.d.ts +16 -0
  65. package/dist/src/timer-utils.js +146 -0
  66. package/dist/src/timer-utils.js.map +1 -0
  67. package/dist/src/transaction-utils.d.ts +14 -0
  68. package/dist/src/transaction-utils.js +157 -0
  69. package/dist/src/transaction-utils.js.map +1 -0
  70. package/dist/src/validation-utils.d.ts +80 -0
  71. package/dist/src/validation-utils.js +249 -0
  72. package/dist/src/validation-utils.js.map +1 -0
  73. package/dist/src/wtf-utils.d.ts +7 -0
  74. package/dist/src/wtf-utils.js +88 -0
  75. package/dist/src/wtf-utils.js.map +1 -0
  76. package/package.json +1 -1
@@ -0,0 +1,36 @@
1
+ export * from './src/array-utils';
2
+ export * from './src/date-utils';
3
+ export * from './src/env-utils';
4
+ export * from './src/error-utils';
5
+ export * from './src/isset';
6
+ export * from './src/logger-utils';
7
+ export * from './src/loop-utils';
8
+ export * from './src/math-utils';
9
+ export * from './src/mongo-utils';
10
+ export * from './src/object-utils';
11
+ export * from './src/string-utils';
12
+ export * from './src/wtf-utils';
13
+ export * from './src/validation-utils';
14
+ export * from './src/transaction-utils';
15
+ export * from './src/timer-utils';
16
+ export * from './src/is-empty';
17
+ export * from './src/remove-circular-json-stringify';
18
+ export * from './src/is-object';
19
+ export * from './src/regexp-utils';
20
+ export * from './src/private/error-handler';
21
+ export { registerConfig } from './src/config';
22
+ import { moyenne } from './src/math-utils';
23
+ import { kebabCase, snakeCase } from './src/string-utils';
24
+ import { shuffleArray, noDuplicateFilter } from './src/array-utils';
25
+ import { issetOr, validator } from './src/validation-utils';
26
+ import { objFilterUndefinedRecursive } from './src/object-utils';
27
+ export declare const int: typeof parseInt;
28
+ export declare const average: typeof moyenne;
29
+ export declare const arrayUniqueValue: typeof noDuplicateFilter;
30
+ export declare const JSONstringyParse: (o: any) => any;
31
+ export declare const removeUndefinedKeys: typeof objFilterUndefinedRecursive;
32
+ export declare const randomizeArray: typeof shuffleArray;
33
+ export declare const dashCase: typeof kebabCase;
34
+ export declare const underscoreCase: typeof snakeCase;
35
+ export declare const required: typeof validator;
36
+ export declare const orIsset: typeof issetOr;
package/dist/index.js ADDED
@@ -0,0 +1,58 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ exports.orIsset = exports.required = exports.underscoreCase = exports.dashCase = exports.randomizeArray = exports.removeUndefinedKeys = exports.JSONstringyParse = exports.arrayUniqueValue = exports.average = exports.int = exports.registerConfig = void 0;
18
+ __exportStar(require("./src/array-utils"), exports);
19
+ __exportStar(require("./src/date-utils"), exports);
20
+ __exportStar(require("./src/env-utils"), exports);
21
+ __exportStar(require("./src/error-utils"), exports);
22
+ __exportStar(require("./src/isset"), exports);
23
+ __exportStar(require("./src/logger-utils"), exports);
24
+ __exportStar(require("./src/loop-utils"), exports);
25
+ __exportStar(require("./src/math-utils"), exports);
26
+ __exportStar(require("./src/mongo-utils"), exports);
27
+ __exportStar(require("./src/object-utils"), exports);
28
+ __exportStar(require("./src/string-utils"), exports);
29
+ __exportStar(require("./src/wtf-utils"), exports);
30
+ __exportStar(require("./src/validation-utils"), exports);
31
+ __exportStar(require("./src/transaction-utils"), exports);
32
+ __exportStar(require("./src/timer-utils"), exports);
33
+ __exportStar(require("./src/is-empty"), exports);
34
+ __exportStar(require("./src/remove-circular-json-stringify"), exports);
35
+ __exportStar(require("./src/is-object"), exports);
36
+ __exportStar(require("./src/regexp-utils"), exports);
37
+ __exportStar(require("./src/private/error-handler"), exports);
38
+ var config_1 = require("./src/config");
39
+ Object.defineProperty(exports, "registerConfig", { enumerable: true, get: function () { return config_1.registerConfig; } });
40
+ var math_utils_1 = require("./src/math-utils");
41
+ var string_utils_1 = require("./src/string-utils");
42
+ var array_utils_1 = require("./src/array-utils");
43
+ var validation_utils_1 = require("./src/validation-utils");
44
+ var object_utils_1 = require("./src/object-utils");
45
+ var remove_circular_json_stringify_1 = require("./src/remove-circular-json-stringify");
46
+ // ALIASES
47
+ exports.int = parseInt;
48
+ exports.average = math_utils_1.moyenne;
49
+ exports.arrayUniqueValue = array_utils_1.noDuplicateFilter;
50
+ var JSONstringyParse = function (o) { return JSON.parse((0, remove_circular_json_stringify_1.removeCircularJSONstringify)(o)); };
51
+ exports.JSONstringyParse = JSONstringyParse;
52
+ exports.removeUndefinedKeys = object_utils_1.objFilterUndefinedRecursive;
53
+ exports.randomizeArray = array_utils_1.shuffleArray;
54
+ exports.dashCase = string_utils_1.kebabCase;
55
+ exports.underscoreCase = string_utils_1.snakeCase;
56
+ exports.required = validation_utils_1.validator; // alias for readability
57
+ exports.orIsset = validation_utils_1.issetOr;
58
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,oDAAiC;AACjC,mDAAgC;AAChC,kDAA+B;AAC/B,oDAAiC;AACjC,8CAA2B;AAC3B,qDAAkC;AAClC,mDAAgC;AAChC,mDAAgC;AAChC,oDAAiC;AACjC,qDAAkC;AAClC,qDAAkC;AAClC,kDAA+B;AAC/B,yDAAsC;AACtC,0DAAuC;AACvC,oDAAiC;AACjC,iDAA8B;AAC9B,uEAAoD;AACpD,kDAA+B;AAC/B,qDAAkC;AAClC,8DAA2C;AAC3C,uCAA6C;AAApC,wGAAA,cAAc,OAAA;AAEvB,+CAA0C;AAC1C,mDAAyD;AACzD,iDAAmE;AACnE,2DAA2D;AAC3D,mDAAgE;AAChE,uFAAkF;AAElF,UAAU;AACG,QAAA,GAAG,GAAG,QAAQ,CAAA;AACd,QAAA,OAAO,GAAG,oBAAO,CAAA;AACjB,QAAA,gBAAgB,GAAG,+BAAiB,CAAA;AAC1C,IAAM,gBAAgB,GAAG,UAAA,CAAC,IAAI,OAAA,IAAI,CAAC,KAAK,CAAC,IAAA,4DAA2B,EAAC,CAAC,CAAC,CAAC,EAA1C,CAA0C,CAAA;AAAlE,QAAA,gBAAgB,oBAAkD;AAClE,QAAA,mBAAmB,GAAG,0CAA2B,CAAA;AACjD,QAAA,cAAc,GAAG,0BAAY,CAAA;AAC7B,QAAA,QAAQ,GAAG,wBAAS,CAAA;AACpB,QAAA,cAAc,GAAG,wBAAS,CAAA;AAC1B,QAAA,QAAQ,GAAG,4BAAS,CAAA,CAAC,wBAAwB;AAC7C,QAAA,OAAO,GAAG,0BAAO,CAAA"}
@@ -0,0 +1,56 @@
1
+ export declare function shuffleArray(array: any): any;
2
+ /**
3
+ * Maye sure obj[addr] is an array and push a value to it
4
+ * @param {Object} obj parent object
5
+ * @param {String} addr field name in parent
6
+ * @param {Any} valToPush
7
+ * @param {Boolean} onlyUniqueValues default:false; may be true or a comparision function; (a,b) => return true if they are the same like (a, b) => a.name === b.name
8
+ * @return obj[addr] eventually processed by the callback
9
+ */
10
+ export declare function ensureIsArrayAndPush(obj: object, addr: string, valToPush: any, onlyUniqueValues: Function): any;
11
+ /** If a string is provided, return it as array else return the value */
12
+ export declare function strAsArray(arrOrStr: any): any;
13
+ /** If not an array provided, return the array with the value
14
+ * /!\ NOTE /!\ In case the value is null or undefined, it will return that value
15
+ */
16
+ export declare function asArray<T extends any[] | any>(item: T): T extends undefined ? undefined : T extends any[] ? T : T[];
17
+ /** Array comparison
18
+ * @return {object} { inCommon, notInB, notInA }
19
+ */
20
+ export declare function compareArrays(arrayA: any[], arrayB: any[], compare?: (a: any, b: any) => boolean): {
21
+ inCommon: any[];
22
+ notInB: any[];
23
+ notInA: any[];
24
+ };
25
+ /**
26
+ * @return [] only elements that are both in arrayA and arrayB
27
+ */
28
+ export declare function getArrayInCommon(arrayA?: any[], arrayB?: any[], compare?: (a: any, b: any) => boolean): any[];
29
+ /**
30
+ * @return [] only elements that are in arrayB and not in arrayA
31
+ */
32
+ export declare function getNotInArrayA(arrayA?: any[], arrayB?: any[], compare?: (a: any, b: any) => boolean): any[];
33
+ /**
34
+ * @return [] only elements that are in neither arrayA and arrayB
35
+ */
36
+ export declare function getArrayDiff(arrayA?: any[], arrayB?: any[], compare?: (a: any, b: any) => boolean): any[];
37
+ /** filter duplicate values in an array
38
+ * @param {function} comparisonFn default:(a, b) => a === b. A function that shall return true if two values are considered equal
39
+ * @return {array|function}
40
+ */
41
+ export declare function noDuplicateFilter(arr: any, comparisonFn?: (a: any, b: any) => boolean): any[];
42
+ /** Count number of occurence of item in array */
43
+ export declare function arrayCount(item: any, arr: any[]): number;
44
+ /**
45
+ * Sort an array in an object of subArrays, no duplicate.
46
+ * @param {Array} array
47
+ * @param {function} getFieldFromItem (itemOfArray) => field[String|Number]
48
+ * tell me how you want to sort your Array
49
+ */
50
+ export declare function arrayToObjectSorted(array: any, getFieldFromItem: any): {};
51
+ /**
52
+ * @param {Function} comparisonFunction default: (itemToPush, itemAlreadyInArray) => itemToPush === itemAlreadyInArray; comparison function to consider the added item duplicate
53
+ */
54
+ export declare function pushIfNotExist(arrayToPushInto: any, valueOrArrayOfValuesToBePushed: any, comparisonFunction?: (a: any, b: any) => boolean): any[];
55
+ export declare function isNotEmptyArray(arr: any): boolean;
56
+ export declare function randomItemInArray<T>(array: T[]): T;
@@ -0,0 +1,160 @@
1
+ "use strict";
2
+ var __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {
3
+ if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {
4
+ if (ar || !(i in from)) {
5
+ if (!ar) ar = Array.prototype.slice.call(from, 0, i);
6
+ ar[i] = from[i];
7
+ }
8
+ }
9
+ return to.concat(ar || Array.prototype.slice.call(from));
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.randomItemInArray = exports.isNotEmptyArray = exports.pushIfNotExist = exports.arrayToObjectSorted = exports.arrayCount = exports.noDuplicateFilter = exports.getArrayDiff = exports.getNotInArrayA = exports.getArrayInCommon = exports.compareArrays = exports.asArray = exports.strAsArray = exports.ensureIsArrayAndPush = exports.shuffleArray = void 0;
13
+ //----------------------------------------
14
+ // ARRAY UTILS
15
+ //----------------------------------------
16
+ var object_utils_1 = require("./object-utils");
17
+ var isset_1 = require("./isset");
18
+ function shuffleArray(array) {
19
+ var _a;
20
+ for (var i = array.length - 1; i > 0; i--) {
21
+ var j = Math.floor(Math.random() * (i + 1));
22
+ _a = [array[j], array[i]], array[i] = _a[0], array[j] = _a[1];
23
+ }
24
+ return array;
25
+ }
26
+ exports.shuffleArray = shuffleArray;
27
+ /**
28
+ * Maye sure obj[addr] is an array and push a value to it
29
+ * @param {Object} obj parent object
30
+ * @param {String} addr field name in parent
31
+ * @param {Any} valToPush
32
+ * @param {Boolean} onlyUniqueValues default:false; may be true or a comparision function; (a,b) => return true if they are the same like (a, b) => a.name === b.name
33
+ * @return obj[addr] eventually processed by the callback
34
+ */
35
+ function ensureIsArrayAndPush(obj, addr, valToPush, onlyUniqueValues) {
36
+ return (0, object_utils_1.ensureObjectProp)(obj, addr, [], function (objValue) {
37
+ if ((0, isset_1.isset)(onlyUniqueValues)) {
38
+ var duplicateFound = false;
39
+ if (typeof onlyUniqueValues === 'function')
40
+ duplicateFound = objValue.some(function (a) { return onlyUniqueValues(a, valToPush); });
41
+ else
42
+ duplicateFound = objValue.includes(valToPush);
43
+ if (!duplicateFound)
44
+ objValue.push(valToPush);
45
+ }
46
+ else
47
+ objValue.push(valToPush);
48
+ });
49
+ }
50
+ exports.ensureIsArrayAndPush = ensureIsArrayAndPush;
51
+ /** If a string is provided, return it as array else return the value */
52
+ function strAsArray(arrOrStr) {
53
+ return typeof arrOrStr === 'string' ? [arrOrStr] : arrOrStr;
54
+ }
55
+ exports.strAsArray = strAsArray;
56
+ /** If not an array provided, return the array with the value
57
+ * /!\ NOTE /!\ In case the value is null or undefined, it will return that value
58
+ */
59
+ function asArray(item) {
60
+ return (typeof item === 'undefined' ? item : Array.isArray(item) ? item : [item]);
61
+ }
62
+ exports.asArray = asArray;
63
+ /** Array comparison
64
+ * @return {object} { inCommon, notInB, notInA }
65
+ */
66
+ function compareArrays(arrayA, arrayB, compare) {
67
+ if (compare === void 0) { compare = function (a, b) { return a === b; }; }
68
+ return {
69
+ inCommon: getArrayInCommon(arrayA, arrayB, compare),
70
+ notInB: getNotInArrayA(arrayB, arrayA, compare),
71
+ notInA: getNotInArrayA(arrayA, arrayB, compare),
72
+ };
73
+ }
74
+ exports.compareArrays = compareArrays;
75
+ /**
76
+ * @return [] only elements that are both in arrayA and arrayB
77
+ */
78
+ function getArrayInCommon(arrayA, arrayB, compare) {
79
+ if (arrayA === void 0) { arrayA = []; }
80
+ if (arrayB === void 0) { arrayB = []; }
81
+ if (compare === void 0) { compare = function (a, b) { return a === b; }; }
82
+ if (!Array.isArray(arrayA) || !Array.isArray(arrayB))
83
+ return [];
84
+ else
85
+ return arrayA.filter(function (a) { return arrayB.some(function (b) { return compare(a, b); }); });
86
+ }
87
+ exports.getArrayInCommon = getArrayInCommon;
88
+ /**
89
+ * @return [] only elements that are in arrayB and not in arrayA
90
+ */
91
+ function getNotInArrayA(arrayA, arrayB, compare) {
92
+ if (arrayA === void 0) { arrayA = []; }
93
+ if (arrayB === void 0) { arrayB = []; }
94
+ if (compare === void 0) { compare = function (a, b) { return a === b; }; }
95
+ if (!Array.isArray(arrayA) && Array.isArray(arrayB))
96
+ return arrayB;
97
+ else if (!Array.isArray(arrayB))
98
+ return [];
99
+ else
100
+ return arrayB.filter(function (b) { return !arrayA.some(function (a) { return compare(a, b); }); });
101
+ }
102
+ exports.getNotInArrayA = getNotInArrayA;
103
+ /**
104
+ * @return [] only elements that are in neither arrayA and arrayB
105
+ */
106
+ function getArrayDiff(arrayA, arrayB, compare) {
107
+ if (arrayA === void 0) { arrayA = []; }
108
+ if (arrayB === void 0) { arrayB = []; }
109
+ if (compare === void 0) { compare = function (a, b) { return a === b; }; }
110
+ return __spreadArray(__spreadArray([], getNotInArrayA(arrayA, arrayB, compare), true), getNotInArrayA(arrayB, arrayA, compare), true);
111
+ }
112
+ exports.getArrayDiff = getArrayDiff;
113
+ /** filter duplicate values in an array
114
+ * @param {function} comparisonFn default:(a, b) => a === b. A function that shall return true if two values are considered equal
115
+ * @return {array|function}
116
+ */
117
+ function noDuplicateFilter(arr, comparisonFn) {
118
+ if (comparisonFn === void 0) { comparisonFn = function (a, b) { return a === b; }; }
119
+ return arr.filter(function (a, i, arr) { return arr.findIndex(function (b) { return comparisonFn(a, b); }) === i; });
120
+ }
121
+ exports.noDuplicateFilter = noDuplicateFilter;
122
+ /** Count number of occurence of item in array */
123
+ function arrayCount(item, arr) {
124
+ return arr.reduce(function (total, item2) { return item === item2 ? total + 1 : total; }, 0);
125
+ }
126
+ exports.arrayCount = arrayCount;
127
+ /**
128
+ * Sort an array in an object of subArrays, no duplicate.
129
+ * @param {Array} array
130
+ * @param {function} getFieldFromItem (itemOfArray) => field[String|Number]
131
+ * tell me how you want to sort your Array
132
+ */
133
+ function arrayToObjectSorted(array, getFieldFromItem) {
134
+ var res = {};
135
+ array.forEach(function (item) {
136
+ (0, object_utils_1.objForceWriteIfNotSet)(res, getFieldFromItem(item), []);
137
+ res[getFieldFromItem(item)].push(item);
138
+ });
139
+ return res;
140
+ }
141
+ exports.arrayToObjectSorted = arrayToObjectSorted;
142
+ /**
143
+ * @param {Function} comparisonFunction default: (itemToPush, itemAlreadyInArray) => itemToPush === itemAlreadyInArray; comparison function to consider the added item duplicate
144
+ */
145
+ function pushIfNotExist(arrayToPushInto, valueOrArrayOfValuesToBePushed, comparisonFunction) {
146
+ if (comparisonFunction === void 0) { comparisonFunction = function (a, b) { return a === b; }; }
147
+ var valuesToPush = asArray(valueOrArrayOfValuesToBePushed).filter(function (a) { return !arrayToPushInto.some(function (b) { return comparisonFunction(a, b); }); });
148
+ arrayToPushInto.push.apply(arrayToPushInto, valuesToPush);
149
+ return arrayToPushInto;
150
+ }
151
+ exports.pushIfNotExist = pushIfNotExist;
152
+ function isNotEmptyArray(arr) {
153
+ return Array.isArray(arr) && !!arr.length;
154
+ }
155
+ exports.isNotEmptyArray = isNotEmptyArray;
156
+ function randomItemInArray(array) {
157
+ return array[Math.floor(Math.random() * array.length)];
158
+ }
159
+ exports.randomItemInArray = randomItemInArray;
160
+ //# sourceMappingURL=array-utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"array-utils.js","sourceRoot":"","sources":["../../src/array-utils.ts"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AAC,IAAI,OAAA,CAAC,eAAe,CAAC,IAAI,CAAC,UAAA,CAAC,IAAI,OAAA,kBAAkB,CAAC,CAAC,EAAE,CAAC,CAAC,EAAxB,CAAwB,CAAC,EAApD,CAAoD,CAAC,CAAA;IAC9H,eAAe,CAAC,IAAI,OAApB,eAAe,EAAS,YAAY,EAAC;IACrC,OAAO,eAAe,CAAA;AAC1B,CAAC;AAJD,wCAIC;AAED,SAAgB,eAAe,CAAC,GAAG;IAC/B,OAAO,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,GAAG,CAAC,MAAM,CAAA;AAC7C,CAAC;AAFD,0CAEC;AAED,SAAgB,iBAAiB,CAAI,KAAU;IAC3C,OAAO,KAAK,CAAC,IAAI,CAAC,KAAK,CAAC,IAAI,CAAC,MAAM,EAAE,GAAG,KAAK,CAAC,MAAM,CAAC,CAAC,CAAA;AAC1D,CAAC;AAFD,8CAEC"}
@@ -0,0 +1,44 @@
1
+ import { Color } from './private/types';
2
+ export declare type TopkatUtilConfig = {
3
+ env: string;
4
+ isProd: boolean;
5
+ nbOfLogsToKeep?: number;
6
+ customTypes: object;
7
+ preprocessLog?: Function;
8
+ terminal: {
9
+ noColor: boolean;
10
+ theme: {
11
+ primary: Color;
12
+ shade1: Color;
13
+ shade2: Color;
14
+ bgColor?: Color;
15
+ paddingX?: number;
16
+ paddingY?: number;
17
+ fontColor?: Color;
18
+ pageWidth?: number;
19
+ debugModeColor?: Color;
20
+ };
21
+ };
22
+ };
23
+ /** Allow dynamic changing of config */
24
+ export declare function configFn(): TopkatUtilConfig;
25
+ /** Register custom config
26
+ * @param {object} customConfig { 'email': email => /.+@.+/.test(email), type2 : myTestFunction() }
27
+ * * env: 'development',
28
+ * * customTypes: {},
29
+ * * terminal: {
30
+ * * noColor: false, // disable colored escape sequences like /mOO35...etc
31
+ * * theme: {
32
+ * * primary: [61, 167, 32], // main color (title font)
33
+ * * shade1: [127, 192, 39], // gradient shade 1
34
+ * * shade2: [194, 218, 47], // gradient shade 2
35
+ * * bgColor: false, // background color
36
+ * * paddingX: 2, // nb spaces added before an outputted str
37
+ * * paddingY: 2, //
38
+ * * fontColor: false, // default font color
39
+ * * pageWidth: 53, // page size in character
40
+ * * debugModeColor: [147, 212, 6], // usually orange
41
+ * * }
42
+ * * },
43
+ */
44
+ export declare function registerConfig(customConfig: any): void;
@@ -0,0 +1,66 @@
1
+ "use strict";
2
+ var __assign = (this && this.__assign) || function () {
3
+ __assign = Object.assign || function(t) {
4
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
5
+ s = arguments[i];
6
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
7
+ t[p] = s[p];
8
+ }
9
+ return t;
10
+ };
11
+ return __assign.apply(this, arguments);
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.registerConfig = exports.configFn = void 0;
15
+ var isset_1 = require("./isset");
16
+ var config = {
17
+ env: 'development',
18
+ isProd: false,
19
+ nbOfLogsToKeep: 25,
20
+ customTypes: {},
21
+ terminal: {
22
+ noColor: false,
23
+ theme: {
24
+ primary: [0, 149, 250],
25
+ shade1: [0, 90, 250],
26
+ shade2: [0, 208, 245],
27
+ paddingX: 2,
28
+ paddingY: 2,
29
+ pageWidth: 53,
30
+ debugModeColor: [201, 27, 169],
31
+ }
32
+ },
33
+ };
34
+ /** Allow dynamic changing of config */
35
+ function configFn() { return config; }
36
+ exports.configFn = configFn;
37
+ /** Register custom config
38
+ * @param {object} customConfig { 'email': email => /.+@.+/.test(email), type2 : myTestFunction() }
39
+ * * env: 'development',
40
+ * * customTypes: {},
41
+ * * terminal: {
42
+ * * noColor: false, // disable colored escape sequences like /mOO35...etc
43
+ * * theme: {
44
+ * * primary: [61, 167, 32], // main color (title font)
45
+ * * shade1: [127, 192, 39], // gradient shade 1
46
+ * * shade2: [194, 218, 47], // gradient shade 2
47
+ * * bgColor: false, // background color
48
+ * * paddingX: 2, // nb spaces added before an outputted str
49
+ * * paddingY: 2, //
50
+ * * fontColor: false, // default font color
51
+ * * pageWidth: 53, // page size in character
52
+ * * debugModeColor: [147, 212, 6], // usually orange
53
+ * * }
54
+ * * },
55
+ */
56
+ function registerConfig(customConfig) {
57
+ if (!(0, isset_1.isset)(customConfig.terminal))
58
+ customConfig.terminal = {};
59
+ var newconfig = __assign(__assign({}, config), customConfig);
60
+ newconfig.terminal = __assign(__assign({}, config.terminal), customConfig.terminal);
61
+ newconfig.terminal.theme = __assign(__assign({}, config.terminal.theme), (customConfig.terminal.theme || {}));
62
+ config = newconfig;
63
+ config.isProd = config.env.includes('prod');
64
+ }
65
+ exports.registerConfig = registerConfig;
66
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/config.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AACA,iCAA+B;AAwB/B,IAAI,MAAM,GAAqB;IAC3B,GAAG,EAAE,aAAa;IAClB,MAAM,EAAE,KAAK;IACb,cAAc,EAAE,EAAE;IAClB,WAAW,EAAE,EAAE;IACf,QAAQ,EAAE;QACN,OAAO,EAAE,KAAK;QACd,KAAK,EAAE;YACH,OAAO,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC;YACtB,MAAM,EAAE,CAAC,CAAC,EAAE,EAAE,EAAE,GAAG,CAAC;YACpB,MAAM,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,GAAG,CAAC;YACrB,QAAQ,EAAE,CAAC;YACX,QAAQ,EAAE,CAAC;YACX,SAAS,EAAE,EAAE;YACb,cAAc,EAAE,CAAC,GAAG,EAAE,EAAE,EAAE,GAAG,CAAC;SACjC;KACJ;CACJ,CAAA;AAED,uCAAuC;AACvC,SAAgB,QAAQ,KAAK,OAAO,MAAM,CAAA,CAAC,CAAC;AAA5C,4BAA4C;AAG5C;;;;;;;;;;;;;;;;;;GAkBG;AACH,SAAgB,cAAc,CAAC,YAAY;IACvC,IAAI,CAAC,IAAA,aAAK,EAAC,YAAY,CAAC,QAAQ,CAAC;QAAE,YAAY,CAAC,QAAQ,GAAG,EAAE,CAAA;IAC7D,IAAM,SAAS,yBACR,MAAM,GACN,YAAY,CAClB,CAAA;IACD,SAAS,CAAC,QAAQ,yBACX,MAAM,CAAC,QAAQ,GACf,YAAY,CAAC,QAAQ,CAC3B,CAAA;IACD,SAAS,CAAC,QAAQ,CAAC,KAAK,yBACjB,MAAM,CAAC,QAAQ,CAAC,KAAK,GACrB,CAAC,YAAY,CAAC,QAAQ,CAAC,KAAK,IAAI,EAAE,CAAC,CACzC,CAAA;IACD,MAAM,GAAG,SAAS,CAAA;IAElB,MAAM,CAAC,MAAM,GAAG,MAAM,CAAC,GAAG,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAA;AAC/C,CAAC;AAjBD,wCAiBC"}
@@ -0,0 +1,100 @@
1
+ export declare function getDateAsInt12(dateAllFormat?: Date | string | number, errIfNotValid?: any): string;
2
+ export declare function humanReadableTimestamp(dateAllFormat: any): number;
3
+ /** format for 6/8/2018 => 20180806
4
+ * @param dateAllFormat multiple format allowed 2012, 20120101, 201201011200, new Date(), "2019-12-08T16:19:10.341Z" and all string that new Date() can parse
5
+ */
6
+ export declare function getDateAsInt(dateAllFormat?: Date | string | number, errIfNotValid$?: boolean, withHoursAndMinutes$?: boolean): string;
7
+ export declare function getMonthAsInt(dateAllFormat?: Date | string | number): number;
8
+ /**
9
+ * @param dateAllFormat multiple format allowed 2012, 20120101, 201201011200, new Date(), "2019-12-08T16:19:10.341Z" and all string that new Date() can parse
10
+ */
11
+ export declare function getDateAsObject(dateAllFormat?: any, errIfNotValid$?: boolean): Date;
12
+ /** [2018,01,06] */
13
+ export declare function dateStringToArray(strOrInt: any): any[];
14
+ /**
15
+ * @param dateAllFormat default: actualDate
16
+ * @returns ['01', '01', '2019'] OR **string** if separator is provided */
17
+ export declare function dateArray(dateAllFormat?: Date | string | number): [string, string, string];
18
+ /**
19
+ * @param dateAllFormat default: actualDate
20
+ * @returns ['01', '01', '2019'] OR **string** if separator is provided */
21
+ export declare function dateArrayInt(dateAllFormat?: Date | string | number): [number, number, number];
22
+ /**
23
+ * @return 01/01/2012 (alias of dateArrayFormatted(date, '/'))
24
+ */
25
+ export declare function dateFormatted(dateAllFormat: Date | string | number, separator?: string): string;
26
+ /** Date with custom offset (Ex: +2 for France) */
27
+ export declare function dateOffset(offsetHours: any, dateObj?: Date): Date;
28
+ /** */
29
+ export declare function getTimeAsInt(timeOrDateInt?: any): number | "dateInvalid";
30
+ /**
31
+ * @param {timeInt|dateInt12} Eg: 2222 OR 201201012222. Default, actual dateInt12
32
+ * @param {String} separator default: ":"
33
+ */
34
+ export declare function getIntAsTime(intOrDateTimeInt?: string, separator?: string): string;
35
+ export declare function isTimeStringValid(timeStr: any, outputAnError$?: boolean): boolean;
36
+ export declare function getDuration(startDate: any, endDate: any, inMinutes?: boolean): number | number[];
37
+ /** compare two object with DATE INT, if they overlap return true
38
+ * @param {Object} event1 {startDate, endDate}
39
+ * @param {Object} event2 {startDate, endDate}
40
+ * @param {String} fieldNameForStartDate$ replace startDate with this string
41
+ * @param {String} fieldNameForEndDate$ replace endDate with this string
42
+ * @param {Boolean} allowNull$ if false, retrun false if any of the startdates or enddates are not set
43
+ * @param {Boolean} strict$ if true,
44
+ */
45
+ export declare function doDateOverlap(event1: any, event2: any, fieldNameForStartDate$?: string, fieldNameForEndDate$?: string, allowNull$?: boolean, strict$?: boolean): boolean;
46
+ declare type DateAllFormat = DateObjectFormat | DateStringFormats;
47
+ declare type DateStringFormats = 'dateInt8' | 'dateInt12' | 'humanReadableTimestamp';
48
+ declare type DateObjectFormat = 'date';
49
+ export declare function nextWeekDay(fromDate: any, weekDayInt?: 0 | 1 | 2 | 3 | 4 | 5 | 6, outputFormat?: DateStringFormats, sameDayAllowed?: boolean): number;
50
+ export declare function nextWeekDay(fromDate: any, weekDayInt?: 0 | 1 | 2 | 3 | 4 | 5 | 6, outputFormat?: DateObjectFormat, sameDayAllowed?: boolean): Date;
51
+ /**
52
+ * @param {String} outputFormat dateInt, dateInt8, dateInt12, date, humanReadableTimestamp, int (dateInt8)
53
+ */
54
+ export declare function addDays(dateAllFormat?: Date | string | number, numberOfDays?: number, outputFormat?: 'dateInt8' | 'dateInt12' | 'humanReadableTimestamp'): string;
55
+ export declare function addDays(dateAllFormat?: Date | string | number, numberOfDays?: number, outputFormat?: 'date'): Date;
56
+ /**
57
+ * @param {String} outputFormat dateInt, dateInt8, dateInt12, date, humanReadableTimestamp, int (dateInt8)
58
+ */
59
+ export declare function addMinutes(dateAllFormat?: Date | string | number, numberOfMinutes?: number, outputFormat?: DateStringFormats): string;
60
+ export declare function addMinutes(dateAllFormat?: Date | string | number, numberOfMinutes?: number, outputFormat?: DateObjectFormat): Date;
61
+ /**
62
+ * @param {String} outputFormat dateInt, dateInt8, dateInt12, date, humanReadableTimestamp, int (dateInt8)
63
+ */
64
+ export declare function addHours(dateAllFormat?: Date | string | number, numberOfHours?: number, outputFormat?: 'dateInt8' | 'dateInt12' | 'humanReadableTimestamp'): string;
65
+ export declare function addHours(dateAllFormat?: Date | string | number, numberOfHours?: number, outputFormat?: 'date'): Date;
66
+ /**
67
+ * @param {String} outputFormat dateInt, dateInt8, dateInt12, date, humanReadableTimestamp, int (dateInt8)
68
+ */
69
+ export declare function addMonths(dateAllFormat?: Date | string | number, numberOfMonths?: number, outputFormat?: 'dateInt8' | 'dateInt12' | 'humanReadableTimestamp'): string;
70
+ export declare function addMonths(dateAllFormat?: Date | string | number, numberOfMonths?: number, outputFormat?: 'date'): Date;
71
+ /**
72
+ * @param {String} outputFormat dateInt, dateInt8, dateInt12, date, humanReadableTimestamp, int (dateInt8)
73
+ */
74
+ export declare function addYears(dateAllFormat?: Date | string | number, numberOfYears?: number, outputFormat?: DateAllFormat): Date;
75
+ export declare function getDayOfMonth(dateAllFormat?: Date | string | number): any;
76
+ export declare function getYear(dateAllFormat?: Date | string | number): any;
77
+ export declare function getHours(dateAllFormat?: Date | string | number): any;
78
+ export declare function getMinutes(dateAllFormat?: Date | string | number): any;
79
+ /**
80
+ * @param {String} outputFormat dateInt, dateInt8, dateInt12, date, humanReadableTimestamp, int (dateInt8)
81
+ */
82
+ export declare function lastDayOfMonth(dateAllFormat?: Date | string | number, outputFormat?: DateAllFormat): Date;
83
+ /**
84
+ * @param {String} outputFormat dateInt, dateInt8, dateInt12, date, humanReadableTimestamp, int (dateInt8)
85
+ */
86
+ export declare function firstDayOfMonth(dateAllFormat?: Date | string | number, outputFormat?: DateAllFormat): Date;
87
+ export declare function differenceInMilliseconds(startDateAllFormat: any, endDateAllFormat: any): number;
88
+ export declare function differenceInSeconds(startDateAllFormat: any, endDateAllFormat: any): number;
89
+ export declare function differenceInMinutes(startDateAllFormat: any, endDateAllFormat: any): number;
90
+ export declare function differenceInHours(startDateAllFormat: any, endDateAllFormat: any): number;
91
+ export declare function differenceInDays(startDateAllFormat: any, endDateAllFormat: any): number;
92
+ export declare function differenceInWeeks(startDateAllFormat: any, endDateAllFormat: any): number;
93
+ /**
94
+ * @param {String} outputDateFormat dateInt, dateInt8, dateInt12, date, humanReadableTimestamp, int (dateInt8)
95
+ */
96
+ export declare function getDateAs(dateAllFormat?: Date | string | number, outputFormat?: 'dateInt8' | 'dateInt12' | 'humanReadableTimestamp'): string;
97
+ export declare function getDateAs(dateAllFormat?: Date | string | number, outputFormat?: 'date'): Date;
98
+ export declare function isDateIntOrStringValid(dateStringOrInt: any, outputAnError?: boolean, length?: any): boolean;
99
+ export declare function isDateIsoOrObjectValid(dateIsoOrObj: any, outputAnError?: boolean): boolean;
100
+ export {};