asv-hlps 1.4.53 → 1.4.55

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.
@@ -43,6 +43,7 @@ export declare const diffArraysByProp: (arr1: any[], arr2: any[], propArr1?: str
43
43
  export declare const removeString: (text: string, word: string) => string;
44
44
  export declare const stringifyFormatter: (data: any, space?: string | number) => string;
45
45
  export declare const removeBackSlashOccurences: (text: string, toChar: string) => string;
46
+ export declare const removeAMPM: (ref: string) => string;
46
47
  export declare const refGenerator: (char?: string, regex?: RegExp, toChar?: string) => string;
47
48
  export declare const genSequenceRef: (refs: any[], startChars: string, zeroFillWidth: number, dateFormat?: string) => string;
48
49
  export declare const sesStorageSet: (key: string, val: any) => void;
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.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;
6
+ 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.removeAMPM = 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 = exports.genRandomColour = 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"));
@@ -275,20 +275,26 @@ const removeBackSlashOccurences = (text, toChar) => {
275
275
  return String(text).toLowerCase().replace(regex, toChar) || text;
276
276
  };
277
277
  exports.removeBackSlashOccurences = removeBackSlashOccurences;
278
- /* export const refGenerator = (char: string = "c", regex: RegExp = /\/+/gi, toChar: string = "") => {
279
- let date = new Date();
280
- const nDate = char.toUpperCase() + date.toLocaleDateString().split("-").join("") + date.toLocaleTimeString().split(":").join("");
281
- return replaceAllIn(nDate, regex, toChar).toLocaleUpperCase();
282
- }; */
278
+ const removeAMPM = (ref) => {
279
+ return ref.indexOf(" ") ? ref.substring(0, ref.indexOf(" ")).trim() : ref;
280
+ };
281
+ exports.removeAMPM = removeAMPM;
283
282
  const refGenerator = (char = "c", regex = /\/+/gi, toChar = "") => {
284
283
  let date = new Date();
285
- let nDate = char.toUpperCase() +
286
- date.toLocaleDateString().split("-").join("") +
287
- date.toLocaleTimeString("en-US", { hour12: false }).split(":").join("");
288
- nDate = (0, exports.replaceAllIn)(nDate, regex, toChar).toLocaleUpperCase();
289
- return nDate.indexOf(" ") ? nDate.substring(0, nDate.indexOf(" ")).trim() : nDate;
284
+ const nDate = char.toUpperCase() + date.toLocaleDateString().split("-").join("") + date.toLocaleTimeString().split(":").join("");
285
+ const ref = (0, exports.replaceAllIn)(nDate, regex, toChar).toLocaleUpperCase();
286
+ return (0, exports.removeAMPM)(ref);
290
287
  };
291
288
  exports.refGenerator = refGenerator;
289
+ // export const refGenerator = (char: string = "c", regex: RegExp = /\/+/gi, toChar: string = "") => {
290
+ // let date = new Date();
291
+ // let nDate =
292
+ // char.toUpperCase() +
293
+ // date.toLocaleDateString().split("-").join("") +
294
+ // date.toLocaleTimeString("en-US", { hour12: false }).split(":").join("");
295
+ // nDate = replaceAllIn(nDate, regex, toChar).toLocaleUpperCase();
296
+ // return nDate.indexOf(" ") ? nDate.substring(0, nDate.indexOf(" ")).trim() : nDate;
297
+ // };
292
298
  const genSequenceRef = (refs, startChars, zeroFillWidth, dateFormat = "") => {
293
299
  if (!refs.length) {
294
300
  return startChars + dateFormat + (0, exports.fillNumWithZero)(1, zeroFillWidth);
@@ -43,6 +43,7 @@ export declare const diffArraysByProp: (arr1: any[], arr2: any[], propArr1?: str
43
43
  export declare const removeString: (text: string, word: string) => string;
44
44
  export declare const stringifyFormatter: (data: any, space?: string | number) => string;
45
45
  export declare const removeBackSlashOccurences: (text: string, toChar: string) => string;
46
+ export declare const removeAMPM: (ref: string) => string;
46
47
  export declare const refGenerator: (char?: string, regex?: RegExp, toChar?: string) => string;
47
48
  export declare const genSequenceRef: (refs: any[], startChars: string, zeroFillWidth: number, dateFormat?: string) => string;
48
49
  export declare const sesStorageSet: (key: string, val: any) => void;
package/lib/esm/utils.js CHANGED
@@ -238,19 +238,24 @@ 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
- }; */
241
+ export const removeAMPM = (ref) => {
242
+ return ref.indexOf(" ") ? ref.substring(0, ref.indexOf(" ")).trim() : ref;
243
+ };
246
244
  export const refGenerator = (char = "c", regex = /\/+/gi, toChar = "") => {
247
245
  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
- };
246
+ const nDate = char.toUpperCase() + date.toLocaleDateString().split("-").join("") + date.toLocaleTimeString().split(":").join("");
247
+ const ref = replaceAllIn(nDate, regex, toChar).toLocaleUpperCase();
248
+ return removeAMPM(ref);
249
+ };
250
+ // export const refGenerator = (char: string = "c", regex: RegExp = /\/+/gi, toChar: string = "") => {
251
+ // let date = new Date();
252
+ // let nDate =
253
+ // char.toUpperCase() +
254
+ // date.toLocaleDateString().split("-").join("") +
255
+ // date.toLocaleTimeString("en-US", { hour12: false }).split(":").join("");
256
+ // nDate = replaceAllIn(nDate, regex, toChar).toLocaleUpperCase();
257
+ // return nDate.indexOf(" ") ? nDate.substring(0, nDate.indexOf(" ")).trim() : nDate;
258
+ // };
254
259
  export const genSequenceRef = (refs, startChars, zeroFillWidth, dateFormat = "") => {
255
260
  if (!refs.length) {
256
261
  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.53",
3
+ "version": "1.4.55",
4
4
  "description": "helpers",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",