asv-hlps 1.4.52 → 1.4.54

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.
@@ -33,6 +33,7 @@ export declare const currencyFormatter: (val: number, separator?: string, curren
33
33
  export declare const currencyFormatterCfa: (val: number) => string;
34
34
  export declare const notInSequence: (arr: number[]) => number[];
35
35
  export declare const sequencesToNumbers: (arr: any[]) => number[];
36
+ export declare const removeAccent: (str: string) => string;
36
37
  export declare const findSequencesMissing: (arr: any[]) => number[];
37
38
  export declare const fillNumWithZero: (num: number, targetLength: number) => string;
38
39
  export declare const findFirstSequenceMissing: (arr: any[]) => number;
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.getColorAccordingToDate = exports.genRandomColour = exports.formatNgbDate = exports.dateNth = exports.dateNthMonth = exports.dateNthDay = exports.dateNthWeek = 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.currencyFormatter = exports.checkAuth = exports.wakeUp = exports.sleep = exports.limitTo = exports.titleCase = exports.toObjectDate = exports.duplicateObjectsGrouped = exports.duplicateObjects = exports.removeDuplicateValues = exports.removeDuplicateObjects = exports.getRandomColor = exports.calPercent = exports.percentOf = exports.genDateMinutesStep = exports.formatDateFirstDayFr = exports.isEmpty = void 0;
7
- exports.nthIndexOf = exports.pathName = exports.checkObjInArray = exports.arraySome = exports.winMaxHeight = exports.toggleProp = exports.roundLastNDigits = exports.removeParamKeyName = exports.countryIsoToFlag = exports.monthStringName = exports.returnBool = exports.formatAmountToString = exports.reduceTimes = exports.reduceSum = exports.sumAmount = exports.fillEndWithZero = exports.fillStartWithZero = exports.absFromSequence = exports.returnDates = exports.displayFrDatePeriode = exports.getArrayOfRandomColor = exports.randomHslColor = exports.randomHexColor = exports.genRandomNumberArray = exports.randomRgbColor = exports.randomInteger = exports.insertAtInArray = exports.isBirthday = exports.padEndWithZero = exports.padStartWithZero = exports.formatMonthYearToLocaleString = exports.calculPercent = exports.validEmail = exports.convertToCfa = exports.packAndUnit = exports.unCheckedAll = exports.inputChecked = exports.arrayMultiChecked = exports.getPeriodDateColor = void 0;
6
+ exports.genRandomColour = exports.formatNgbDate = exports.dateNth = exports.dateNthMonth = exports.dateNthDay = exports.dateNthWeek = 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.removeAccent = exports.sequencesToNumbers = exports.notInSequence = exports.currencyFormatterCfa = exports.currencyFormatter = exports.checkAuth = exports.wakeUp = exports.sleep = exports.limitTo = exports.titleCase = exports.toObjectDate = exports.duplicateObjectsGrouped = exports.duplicateObjects = exports.removeDuplicateValues = exports.removeDuplicateObjects = exports.getRandomColor = exports.calPercent = exports.percentOf = exports.genDateMinutesStep = exports.formatDateFirstDayFr = exports.isEmpty = void 0;
7
+ exports.nthIndexOf = exports.pathName = exports.checkObjInArray = exports.arraySome = exports.winMaxHeight = exports.toggleProp = exports.roundLastNDigits = exports.removeParamKeyName = exports.countryIsoToFlag = exports.monthStringName = exports.returnBool = exports.formatAmountToString = exports.reduceTimes = exports.reduceSum = exports.sumAmount = exports.fillEndWithZero = exports.fillStartWithZero = exports.absFromSequence = exports.returnDates = exports.displayFrDatePeriode = exports.getArrayOfRandomColor = exports.randomHslColor = exports.randomHexColor = exports.genRandomNumberArray = exports.randomRgbColor = exports.randomInteger = exports.insertAtInArray = exports.isBirthday = exports.padEndWithZero = exports.padStartWithZero = exports.formatMonthYearToLocaleString = exports.calculPercent = exports.validEmail = exports.convertToCfa = exports.packAndUnit = exports.unCheckedAll = exports.inputChecked = exports.arrayMultiChecked = exports.getPeriodDateColor = exports.getColorAccordingToDate = void 0;
8
8
  const dayjs_1 = __importDefault(require("dayjs"));
9
9
  const dayOfYear_1 = __importDefault(require("dayjs/plugin/dayOfYear"));
10
10
  const isSameOrBefore_1 = __importDefault(require("dayjs/plugin/isSameOrBefore"));
@@ -227,6 +227,7 @@ exports.sequencesToNumbers = sequencesToNumbers;
227
227
  const removeAccent = (str) => {
228
228
  return (0, remove_accents_1.default)(str);
229
229
  };
230
+ exports.removeAccent = removeAccent;
230
231
  const findSequencesMissing = (arr) => {
231
232
  const seqs = [];
232
233
  for (const item of arr) {
@@ -274,20 +275,21 @@ const removeBackSlashOccurences = (text, toChar) => {
274
275
  return String(text).toLowerCase().replace(regex, toChar) || text;
275
276
  };
276
277
  exports.removeBackSlashOccurences = removeBackSlashOccurences;
277
- /* export const refGenerator = (char: string = "c", regex: RegExp = /\/+/gi, toChar: string = "") => {
278
- let date = new Date();
279
- const nDate = char.toUpperCase() + date.toLocaleDateString().split("-").join("") + date.toLocaleTimeString().split(":").join("");
280
- return replaceAllIn(nDate, regex, toChar).toLocaleUpperCase();
281
- }; */
282
278
  const refGenerator = (char = "c", regex = /\/+/gi, toChar = "") => {
283
279
  let date = new Date();
284
- let nDate = char.toUpperCase() +
285
- date.toLocaleDateString().split("-").join("") +
286
- date.toLocaleTimeString("en-US", { hour12: false }).split(":").join("");
287
- nDate = (0, exports.replaceAllIn)(nDate, regex, toChar).toLocaleUpperCase();
288
- return nDate.indexOf(" ") ? nDate.substring(0, nDate.indexOf(" ")).trim() : nDate;
280
+ const nDate = char.toUpperCase() + date.toLocaleDateString().split("-").join("") + date.toLocaleTimeString().split(":").join("");
281
+ return (0, exports.replaceAllIn)(nDate, regex, toChar).toLocaleUpperCase();
289
282
  };
290
283
  exports.refGenerator = refGenerator;
284
+ // export const refGenerator = (char: string = "c", regex: RegExp = /\/+/gi, toChar: string = "") => {
285
+ // let date = new Date();
286
+ // let nDate =
287
+ // char.toUpperCase() +
288
+ // date.toLocaleDateString().split("-").join("") +
289
+ // date.toLocaleTimeString("en-US", { hour12: false }).split(":").join("");
290
+ // nDate = replaceAllIn(nDate, regex, toChar).toLocaleUpperCase();
291
+ // return nDate.indexOf(" ") ? nDate.substring(0, nDate.indexOf(" ")).trim() : nDate;
292
+ // };
291
293
  const genSequenceRef = (refs, startChars, zeroFillWidth, dateFormat = "") => {
292
294
  if (!refs.length) {
293
295
  return startChars + dateFormat + (0, exports.fillNumWithZero)(1, zeroFillWidth);
@@ -33,6 +33,7 @@ export declare const currencyFormatter: (val: number, separator?: string, curren
33
33
  export declare const currencyFormatterCfa: (val: number) => string;
34
34
  export declare const notInSequence: (arr: number[]) => number[];
35
35
  export declare const sequencesToNumbers: (arr: any[]) => number[];
36
+ export declare const removeAccent: (str: string) => string;
36
37
  export declare const findSequencesMissing: (arr: any[]) => number[];
37
38
  export declare const fillNumWithZero: (num: number, targetLength: number) => string;
38
39
  export declare const findFirstSequenceMissing: (arr: any[]) => number;
package/lib/esm/utils.js CHANGED
@@ -197,7 +197,7 @@ export const sequencesToNumbers = (arr) => {
197
197
  }
198
198
  return seqs;
199
199
  };
200
- const removeAccent = (str) => {
200
+ export const removeAccent = (str) => {
201
201
  return removeAccents(str);
202
202
  };
203
203
  export const findSequencesMissing = (arr) => {
@@ -238,19 +238,20 @@ export const removeBackSlashOccurences = (text, toChar) => {
238
238
  const regex = /\/+/gi;
239
239
  return String(text).toLowerCase().replace(regex, toChar) || text;
240
240
  };
241
- /* export const refGenerator = (char: string = "c", regex: RegExp = /\/+/gi, toChar: string = "") => {
242
- let date = new Date();
243
- const nDate = char.toUpperCase() + date.toLocaleDateString().split("-").join("") + date.toLocaleTimeString().split(":").join("");
244
- return replaceAllIn(nDate, regex, toChar).toLocaleUpperCase();
245
- }; */
246
241
  export const refGenerator = (char = "c", regex = /\/+/gi, toChar = "") => {
247
242
  let date = new Date();
248
- let nDate = char.toUpperCase() +
249
- date.toLocaleDateString().split("-").join("") +
250
- date.toLocaleTimeString("en-US", { hour12: false }).split(":").join("");
251
- nDate = replaceAllIn(nDate, regex, toChar).toLocaleUpperCase();
252
- return nDate.indexOf(" ") ? nDate.substring(0, nDate.indexOf(" ")).trim() : nDate;
253
- };
243
+ const nDate = char.toUpperCase() + date.toLocaleDateString().split("-").join("") + date.toLocaleTimeString().split(":").join("");
244
+ return replaceAllIn(nDate, regex, toChar).toLocaleUpperCase();
245
+ };
246
+ // export const refGenerator = (char: string = "c", regex: RegExp = /\/+/gi, toChar: string = "") => {
247
+ // let date = new Date();
248
+ // let nDate =
249
+ // char.toUpperCase() +
250
+ // date.toLocaleDateString().split("-").join("") +
251
+ // date.toLocaleTimeString("en-US", { hour12: false }).split(":").join("");
252
+ // nDate = replaceAllIn(nDate, regex, toChar).toLocaleUpperCase();
253
+ // return nDate.indexOf(" ") ? nDate.substring(0, nDate.indexOf(" ")).trim() : nDate;
254
+ // };
254
255
  export const genSequenceRef = (refs, startChars, zeroFillWidth, dateFormat = "") => {
255
256
  if (!refs.length) {
256
257
  return startChars + dateFormat + fillNumWithZero(1, zeroFillWidth);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asv-hlps",
3
- "version": "1.4.52",
3
+ "version": "1.4.54",
4
4
  "description": "helpers",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",