asv-hlps 1.3.90 → 1.3.91
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 +7 -1
- 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
|
@@ -104,3 +104,4 @@ export declare const removeParamKeyName: (params: any, name?: string) => any;
|
|
|
104
104
|
export declare const roundLastNDigits: (num: number, digits?: number) => number | false;
|
|
105
105
|
export declare const toggleProp: (tob: any, propToToggle: string) => any;
|
|
106
106
|
export declare const arraySome: (arr1: any[], arr2: any[]) => boolean;
|
|
107
|
+
export declare const checkObjInArray: (objs: any[], checkProp: string, prop?: string) => boolean;
|
package/lib/cjs/utils.js
CHANGED
|
@@ -4,7 +4,7 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
6
|
exports.packAndUnit = exports.unCheckedAll = exports.inputChecked = exports.arrayMultiChecked = exports.getPeriodDateColor = exports.getColorAccordingToDate = exports.genRandomColour = exports.formatNgbDate = 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.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 = exports.formatDateFirstDayFr = void 0;
|
|
7
|
-
exports.arraySome = 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 = exports.validEmail = exports.convertToCfa = void 0;
|
|
7
|
+
exports.checkObjInArray = exports.arraySome = 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 = exports.validEmail = exports.convertToCfa = 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"));
|
|
@@ -746,3 +746,9 @@ const arraySome = (arr1, arr2) => {
|
|
|
746
746
|
return arr1.some((x) => arr2.includes(x));
|
|
747
747
|
};
|
|
748
748
|
exports.arraySome = arraySome;
|
|
749
|
+
const checkObjInArray = (objs, checkProp, prop = "id") => {
|
|
750
|
+
return objs.some((x) => {
|
|
751
|
+
return x[prop] === checkProp;
|
|
752
|
+
});
|
|
753
|
+
};
|
|
754
|
+
exports.checkObjInArray = checkObjInArray;
|
package/lib/esm/utils.d.ts
CHANGED
|
@@ -104,3 +104,4 @@ export declare const removeParamKeyName: (params: any, name?: string) => any;
|
|
|
104
104
|
export declare const roundLastNDigits: (num: number, digits?: number) => number | false;
|
|
105
105
|
export declare const toggleProp: (tob: any, propToToggle: string) => any;
|
|
106
106
|
export declare const arraySome: (arr1: any[], arr2: any[]) => boolean;
|
|
107
|
+
export declare const checkObjInArray: (objs: any[], checkProp: string, prop?: string) => boolean;
|
package/lib/esm/utils.js
CHANGED
|
@@ -661,3 +661,8 @@ export const toggleProp = (tob, propToToggle) => {
|
|
|
661
661
|
export const arraySome = (arr1, arr2) => {
|
|
662
662
|
return arr1.some((x) => arr2.includes(x));
|
|
663
663
|
};
|
|
664
|
+
export const checkObjInArray = (objs, checkProp, prop = "id") => {
|
|
665
|
+
return objs.some((x) => {
|
|
666
|
+
return x[prop] === checkProp;
|
|
667
|
+
});
|
|
668
|
+
};
|