asv-hlps 1.4.54 → 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,10 +275,15 @@ const removeBackSlashOccurences = (text, toChar) => {
275
275
  return String(text).toLowerCase().replace(regex, toChar) || text;
276
276
  };
277
277
  exports.removeBackSlashOccurences = removeBackSlashOccurences;
278
+ const removeAMPM = (ref) => {
279
+ return ref.indexOf(" ") ? ref.substring(0, ref.indexOf(" ")).trim() : ref;
280
+ };
281
+ exports.removeAMPM = removeAMPM;
278
282
  const refGenerator = (char = "c", regex = /\/+/gi, toChar = "") => {
279
283
  let date = new Date();
280
284
  const nDate = char.toUpperCase() + date.toLocaleDateString().split("-").join("") + date.toLocaleTimeString().split(":").join("");
281
- return (0, exports.replaceAllIn)(nDate, regex, toChar).toLocaleUpperCase();
285
+ const ref = (0, exports.replaceAllIn)(nDate, regex, toChar).toLocaleUpperCase();
286
+ return (0, exports.removeAMPM)(ref);
282
287
  };
283
288
  exports.refGenerator = refGenerator;
284
289
  // export const refGenerator = (char: string = "c", regex: RegExp = /\/+/gi, toChar: string = "") => {
@@ -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,10 +238,14 @@ 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 removeAMPM = (ref) => {
242
+ return ref.indexOf(" ") ? ref.substring(0, ref.indexOf(" ")).trim() : ref;
243
+ };
241
244
  export const refGenerator = (char = "c", regex = /\/+/gi, toChar = "") => {
242
245
  let date = new Date();
243
246
  const nDate = char.toUpperCase() + date.toLocaleDateString().split("-").join("") + date.toLocaleTimeString().split(":").join("");
244
- return replaceAllIn(nDate, regex, toChar).toLocaleUpperCase();
247
+ const ref = replaceAllIn(nDate, regex, toChar).toLocaleUpperCase();
248
+ return removeAMPM(ref);
245
249
  };
246
250
  // export const refGenerator = (char: string = "c", regex: RegExp = /\/+/gi, toChar: string = "") => {
247
251
  // let date = new Date();
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asv-hlps",
3
- "version": "1.4.54",
3
+ "version": "1.4.55",
4
4
  "description": "helpers",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",