asv-hlps 1.4.57 → 1.4.58

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.
@@ -45,6 +45,7 @@ export declare const stringifyFormatter: (data: any, space?: string | number) =>
45
45
  export declare const removeBackSlashOccurences: (text: string, toChar: string) => string;
46
46
  export declare const removeAMPM: (ref: string) => string;
47
47
  export declare const refGenerator: (char?: string, regex?: RegExp, toChar?: string) => string;
48
+ export declare const removeSpecialCharsAndSpaces: (input: string) => string;
48
49
  export declare const genSequenceRef: (refs: any[], startChars: string, zeroFillWidth: number, dateFormat?: string) => string;
49
50
  export declare const sesStorageSet: (key: string, val: any) => void;
50
51
  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.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;
6
+ 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.removeSpecialCharsAndSpaces = 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 = exports.formatNgbDate = 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"));
@@ -286,6 +286,10 @@ const refGenerator = (char = "c", regex = /\/+/gi, toChar = "") => {
286
286
  return (0, exports.removeAMPM)(ref);
287
287
  };
288
288
  exports.refGenerator = refGenerator;
289
+ const removeSpecialCharsAndSpaces = (input) => {
290
+ return input.replace(/[^a-zA-Z0-9]/g, "");
291
+ };
292
+ exports.removeSpecialCharsAndSpaces = removeSpecialCharsAndSpaces;
289
293
  // export const refGenerator = (char: string = "c", regex: RegExp = /\/+/gi, toChar: string = "") => {
290
294
  // let date = new Date();
291
295
  // let nDate =
@@ -45,6 +45,7 @@ export declare const stringifyFormatter: (data: any, space?: string | number) =>
45
45
  export declare const removeBackSlashOccurences: (text: string, toChar: string) => string;
46
46
  export declare const removeAMPM: (ref: string) => string;
47
47
  export declare const refGenerator: (char?: string, regex?: RegExp, toChar?: string) => string;
48
+ export declare const removeSpecialCharsAndSpaces: (input: string) => string;
48
49
  export declare const genSequenceRef: (refs: any[], startChars: string, zeroFillWidth: number, dateFormat?: string) => string;
49
50
  export declare const sesStorageSet: (key: string, val: any) => void;
50
51
  export declare const sesStorageGet: (key: string) => any;
package/lib/esm/utils.js CHANGED
@@ -247,6 +247,9 @@ export const refGenerator = (char = "c", regex = /\/+/gi, toChar = "") => {
247
247
  const ref = replaceAllIn(nDate, regex, toChar).toLocaleUpperCase();
248
248
  return removeAMPM(ref);
249
249
  };
250
+ export const removeSpecialCharsAndSpaces = (input) => {
251
+ return input.replace(/[^a-zA-Z0-9]/g, "");
252
+ };
250
253
  // export const refGenerator = (char: string = "c", regex: RegExp = /\/+/gi, toChar: string = "") => {
251
254
  // let date = new Date();
252
255
  // let nDate =
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "asv-hlps",
3
- "version": "1.4.57",
3
+ "version": "1.4.58",
4
4
  "description": "helpers",
5
5
  "main": "./lib/cjs/index.js",
6
6
  "module": "./lib/esm/index.js",