asv-hlps 1.3.94 → 1.3.96
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/lib/cjs/utils.d.ts +1 -1
- package/lib/cjs/utils.js +11 -5
- package/lib/esm/utils.d.ts +1 -1
- package/lib/esm/utils.js +9 -3
- package/package.json +5 -5
package/lib/cjs/utils.d.ts
CHANGED
|
@@ -104,6 +104,6 @@ export declare const countryIsoToFlag: (code: string) => string;
|
|
|
104
104
|
export declare const removeParamKeyName: (params: any, name?: string) => any;
|
|
105
105
|
export declare const roundLastNDigits: (num: number, digits?: number) => number | false;
|
|
106
106
|
export declare const toggleProp: (tob: any, propToToggle: string) => any;
|
|
107
|
-
export declare const
|
|
107
|
+
export declare const winMaxHeight: (step?: 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9) => number;
|
|
108
108
|
export declare const arraySome: (arr1: any[], arr2: any[]) => boolean;
|
|
109
109
|
export declare const checkObjInArray: (objs: any[], checkProp: string | number, prop?: string) => boolean;
|
package/lib/cjs/utils.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.unCheckedAll = exports.inputChecked = exports.arrayMultiChecked = exports.getPeriodDateColor = exports.getColorAccordingToDate = exports.genRandomColour = exports.formatNgbDate = exports.getNbOfDaysBetweenTwoDates = exports.displayDateRangeFr = exports.reformatDates = exports.firstDayOfDate = exports.dateToString = exports.dateDiff = exports.dateFormatter = exports.replaceSpacesWith = exports.replaceAllIn = exports.toPlural = exports.sesStorageGet = exports.sesStorageSet = exports.genSequenceRef = exports.refGenerator = exports.removeBackSlashOccurences = exports.stringifyFormatter = exports.removeString = exports.diffArraysByProp = exports.diffArraysByFunc = exports.deepClone = exports.findFirstSequenceMissing = exports.fillNumWithZero = exports.findSequencesMissing = exports.sequencesToNumbers = exports.notInSequence = exports.currencyFormatterCfa = exports.formatToStringCfa = exports.currencyFormatter = exports.formatToString = exports.checkAuth = exports.wakeUp = exports.sleep = exports.limitTo = exports.titleCase = exports.toObjectDate = exports.duplicateObjects = exports.removeDuplicateObjects = exports.getRandomColor = exports.calPercent = exports.percentOf = exports.genDateMinutesStep = exports.formatDateFirstDayFr = exports.isEmpty = void 0;
|
|
7
|
-
exports.checkObjInArray = exports.arraySome = exports.
|
|
7
|
+
exports.checkObjInArray = exports.arraySome = exports.winMaxHeight = exports.toggleProp = exports.roundLastNDigits = exports.removeParamKeyName = exports.countryIsoToFlag = exports.monthStringName = exports.returnBool = exports.formatAmountToString = exports.reduceSum = exports.sumAmount = exports.fillEndWithZero = exports.fillStartWithZero = exports.absFromSequence = exports.returnDates = exports.displayFrDatePeriode = exports.getArrayOfRandomColor = exports.randomHslColor = exports.randomHexColor = exports.randomRgbColor = exports.randomInteger = exports.insertAtInArray = exports.isBirthday = exports.padEndWithZero = exports.padStartWithZero = exports.formatMonthYearToLocaleString = exports.calculPercent = exports.validEmail = exports.convertToCfa = exports.packAndUnit = void 0;
|
|
8
8
|
const dayjs_1 = __importDefault(require("dayjs"));
|
|
9
9
|
const relativeTime_1 = __importDefault(require("dayjs/plugin/relativeTime"));
|
|
10
10
|
const lodash_1 = __importDefault(require("lodash"));
|
|
@@ -254,10 +254,16 @@ const removeBackSlashOccurences = (text, toChar) => {
|
|
|
254
254
|
return String(text).toLowerCase().replace(regex, toChar) || text;
|
|
255
255
|
};
|
|
256
256
|
exports.removeBackSlashOccurences = removeBackSlashOccurences;
|
|
257
|
+
/* export const refGenerator = (char: string = "c", regex: RegExp = /\/+/gi, toChar: string = "") => {
|
|
258
|
+
let date = new Date();
|
|
259
|
+
const nDate = char.toUpperCase() + date.toLocaleDateString().split("-").join("") + date.toLocaleTimeString().split(":").join("");
|
|
260
|
+
return replaceAllIn(nDate, regex, toChar).toLocaleUpperCase();
|
|
261
|
+
}; */
|
|
257
262
|
const refGenerator = (char = "c", regex = /\/+/gi, toChar = "") => {
|
|
258
263
|
let date = new Date();
|
|
259
|
-
|
|
260
|
-
|
|
264
|
+
let nDate = char.toUpperCase() + date.toLocaleDateString().split("-").join("") + date.toLocaleTimeString().split(":").join("");
|
|
265
|
+
nDate = (0, exports.replaceAllIn)(nDate, regex, toChar).toLocaleUpperCase();
|
|
266
|
+
return nDate.indexOf(" ") ? nDate.substring(0, nDate.indexOf(" ")).trim() : nDate;
|
|
261
267
|
};
|
|
262
268
|
exports.refGenerator = refGenerator;
|
|
263
269
|
const genSequenceRef = (refs, startChars, zeroFillWidth, dateFormat = "") => {
|
|
@@ -746,10 +752,10 @@ const toggleProp = (tob, propToToggle) => {
|
|
|
746
752
|
return nTob;
|
|
747
753
|
};
|
|
748
754
|
exports.toggleProp = toggleProp;
|
|
749
|
-
const
|
|
755
|
+
const winMaxHeight = (step) => {
|
|
750
756
|
return step ? window.innerHeight * step : window.innerHeight * 0.5;
|
|
751
757
|
};
|
|
752
|
-
exports.
|
|
758
|
+
exports.winMaxHeight = winMaxHeight;
|
|
753
759
|
const arraySome = (arr1, arr2) => {
|
|
754
760
|
return arr1.some((x) => arr2.includes(x));
|
|
755
761
|
};
|
package/lib/esm/utils.d.ts
CHANGED
|
@@ -104,6 +104,6 @@ export declare const countryIsoToFlag: (code: string) => string;
|
|
|
104
104
|
export declare const removeParamKeyName: (params: any, name?: string) => any;
|
|
105
105
|
export declare const roundLastNDigits: (num: number, digits?: number) => number | false;
|
|
106
106
|
export declare const toggleProp: (tob: any, propToToggle: string) => any;
|
|
107
|
-
export declare const
|
|
107
|
+
export declare const winMaxHeight: (step?: 0.2 | 0.3 | 0.4 | 0.5 | 0.6 | 0.7 | 0.8 | 0.9) => number;
|
|
108
108
|
export declare const arraySome: (arr1: any[], arr2: any[]) => boolean;
|
|
109
109
|
export declare const checkObjInArray: (objs: any[], checkProp: string | number, prop?: string) => boolean;
|
package/lib/esm/utils.js
CHANGED
|
@@ -218,10 +218,16 @@ export const removeBackSlashOccurences = (text, toChar) => {
|
|
|
218
218
|
const regex = /\/+/gi;
|
|
219
219
|
return String(text).toLowerCase().replace(regex, toChar) || text;
|
|
220
220
|
};
|
|
221
|
+
/* export const refGenerator = (char: string = "c", regex: RegExp = /\/+/gi, toChar: string = "") => {
|
|
222
|
+
let date = new Date();
|
|
223
|
+
const nDate = char.toUpperCase() + date.toLocaleDateString().split("-").join("") + date.toLocaleTimeString().split(":").join("");
|
|
224
|
+
return replaceAllIn(nDate, regex, toChar).toLocaleUpperCase();
|
|
225
|
+
}; */
|
|
221
226
|
export const refGenerator = (char = "c", regex = /\/+/gi, toChar = "") => {
|
|
222
227
|
let date = new Date();
|
|
223
|
-
|
|
224
|
-
|
|
228
|
+
let nDate = char.toUpperCase() + date.toLocaleDateString().split("-").join("") + date.toLocaleTimeString().split(":").join("");
|
|
229
|
+
nDate = replaceAllIn(nDate, regex, toChar).toLocaleUpperCase();
|
|
230
|
+
return nDate.indexOf(" ") ? nDate.substring(0, nDate.indexOf(" ")).trim() : nDate;
|
|
225
231
|
};
|
|
226
232
|
export const genSequenceRef = (refs, startChars, zeroFillWidth, dateFormat = "") => {
|
|
227
233
|
if (!refs.length) {
|
|
@@ -661,7 +667,7 @@ export const toggleProp = (tob, propToToggle) => {
|
|
|
661
667
|
nTob[propToToggle] = !nTob[propToToggle];
|
|
662
668
|
return nTob;
|
|
663
669
|
};
|
|
664
|
-
export const
|
|
670
|
+
export const winMaxHeight = (step) => {
|
|
665
671
|
return step ? window.innerHeight * step : window.innerHeight * 0.5;
|
|
666
672
|
};
|
|
667
673
|
export const arraySome = (arr1, arr2) => {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "asv-hlps",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.96",
|
|
4
4
|
"description": "helpers",
|
|
5
5
|
"main": "./lib/cjs/index.js",
|
|
6
6
|
"module": "./lib/esm/index.js",
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
"@types/lodash": "^4.17.7",
|
|
22
22
|
"@types/pdfmake": "^0.2.9",
|
|
23
23
|
"@types/randomatic": "^3.1.5",
|
|
24
|
-
"@types/react": "^18.3.
|
|
24
|
+
"@types/react": "^18.3.8"
|
|
25
25
|
},
|
|
26
26
|
"dependencies": {
|
|
27
27
|
"axios": "^1.7.7",
|
|
@@ -29,13 +29,13 @@
|
|
|
29
29
|
"class-validator": "^0.14.1",
|
|
30
30
|
"classnames": "^2.5.1",
|
|
31
31
|
"dayjs": "^1.11.13",
|
|
32
|
-
"express": "^4.
|
|
32
|
+
"express": "^4.21.0",
|
|
33
33
|
"jwt-decode": "^4.0.0",
|
|
34
34
|
"lodash": "^4.17.21",
|
|
35
|
-
"pdfmake": "^0.2.
|
|
35
|
+
"pdfmake": "^0.2.13",
|
|
36
36
|
"randomatic": "^3.1.1",
|
|
37
37
|
"typeorm": "^0.3.20",
|
|
38
|
-
"typescript": "^5.
|
|
38
|
+
"typescript": "^5.6.2",
|
|
39
39
|
"yup": "^1.4.0"
|
|
40
40
|
}
|
|
41
41
|
}
|