asv-hlps 1.3.67 → 1.3.68
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 -0
- package/lib/cjs/utils.js +8 -2
- package/lib/esm/utils.d.ts +1 -0
- package/lib/esm/utils.js +5 -0
- package/package.json +1 -1
package/lib/cjs/utils.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export declare const diffArraysByProp: (arr1: any[], arr2: any[], propArr1?: str
|
|
|
36
36
|
export declare const removeString: (text: string, word: string) => string;
|
|
37
37
|
export declare const stringifyFormatter: (data: any, space?: string | number) => string;
|
|
38
38
|
export declare const removeBackSlashOccurences: (text: string, toChar: string) => string;
|
|
39
|
+
export declare const refGenerator: (char?: string, regex?: RegExp, toChar?: string) => string;
|
|
39
40
|
export declare const genSequenceRef: (refs: any[], startChars: string, zeroFillWidth: number, dateFormat?: string) => string;
|
|
40
41
|
export declare const sesStorageSet: (key: string, val: any) => void;
|
|
41
42
|
export declare const sesStorageGet: (key: string) => any;
|
package/lib/cjs/utils.js
CHANGED
|
@@ -3,8 +3,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
7
|
-
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 = void 0;
|
|
6
|
+
exports.validEmail = exports.convertToCfa = exports.packAndUnit = exports.unCheckedAll = exports.inputChecked = exports.arrayMultiChecked = exports.getPeriodDateColor = exports.getColorAccordingToDate = exports.genRandomColour = exports.formatNgbDate = exports.getNbOfDaysBetweenTwoDates = exports.displayDateRangeFr = exports.reformatDates = 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 = void 0;
|
|
7
|
+
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 = 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"));
|
|
@@ -249,6 +249,12 @@ const removeBackSlashOccurences = (text, toChar) => {
|
|
|
249
249
|
return String(text).toLowerCase().replace(regex, toChar) || text;
|
|
250
250
|
};
|
|
251
251
|
exports.removeBackSlashOccurences = removeBackSlashOccurences;
|
|
252
|
+
const refGenerator = (char = "c", regex = /\/+/gi, toChar = "") => {
|
|
253
|
+
let date = new Date();
|
|
254
|
+
const nDate = char.toUpperCase() + date.toLocaleDateString().split("-").join("") + date.toLocaleTimeString().split(":").join("");
|
|
255
|
+
return (0, exports.replaceAllIn)(nDate, regex, toChar).toLocaleUpperCase();
|
|
256
|
+
};
|
|
257
|
+
exports.refGenerator = refGenerator;
|
|
252
258
|
const genSequenceRef = (refs, startChars, zeroFillWidth, dateFormat = "") => {
|
|
253
259
|
if (!refs.length) {
|
|
254
260
|
return startChars + dateFormat + (0, exports.fillNumWithZero)(1, zeroFillWidth);
|
package/lib/esm/utils.d.ts
CHANGED
|
@@ -36,6 +36,7 @@ export declare const diffArraysByProp: (arr1: any[], arr2: any[], propArr1?: str
|
|
|
36
36
|
export declare const removeString: (text: string, word: string) => string;
|
|
37
37
|
export declare const stringifyFormatter: (data: any, space?: string | number) => string;
|
|
38
38
|
export declare const removeBackSlashOccurences: (text: string, toChar: string) => string;
|
|
39
|
+
export declare const refGenerator: (char?: string, regex?: RegExp, toChar?: string) => string;
|
|
39
40
|
export declare const genSequenceRef: (refs: any[], startChars: string, zeroFillWidth: number, dateFormat?: string) => string;
|
|
40
41
|
export declare const sesStorageSet: (key: string, val: any) => void;
|
|
41
42
|
export declare const sesStorageGet: (key: string) => any;
|
package/lib/esm/utils.js
CHANGED
|
@@ -215,6 +215,11 @@ export const removeBackSlashOccurences = (text, toChar) => {
|
|
|
215
215
|
const regex = /\/+/gi;
|
|
216
216
|
return String(text).toLowerCase().replace(regex, toChar) || text;
|
|
217
217
|
};
|
|
218
|
+
export const refGenerator = (char = "c", regex = /\/+/gi, toChar = "") => {
|
|
219
|
+
let date = new Date();
|
|
220
|
+
const nDate = char.toUpperCase() + date.toLocaleDateString().split("-").join("") + date.toLocaleTimeString().split(":").join("");
|
|
221
|
+
return replaceAllIn(nDate, regex, toChar).toLocaleUpperCase();
|
|
222
|
+
};
|
|
218
223
|
export const genSequenceRef = (refs, startChars, zeroFillWidth, dateFormat = "") => {
|
|
219
224
|
if (!refs.length) {
|
|
220
225
|
return startChars + dateFormat + fillNumWithZero(1, zeroFillWidth);
|