eco-vue-js 0.4.10 → 0.4.11
Sign up to get free protection for your applications and to get access to all the features.
- package/dist/main.js +1 -1
- package/dist/utils/utils.d.ts +1 -0
- package/dist/utils/utils.d.ts.map +1 -1
- package/dist/utils/utils.js +11 -2
- package/package.json +1 -1
package/dist/main.js
CHANGED
@@ -70,4 +70,4 @@ export { SemanticType } from './utils/SemanticType.js';
|
|
70
70
|
export { HorizontalAlign } from './utils/HorizontalAlign.js';
|
71
71
|
export { Month, WeekDay, addDay, addMonth, addYear, dateFormat, dateFormatter, dateRegexp, dateToQueryString, datetimeFormat, durationHumanize, getDurationRound, getStartOfDay, getStartOfMonth, getStartOfWeek, isSameDate, isSameMonth, isSameYear, monthShortFormatter, parseDate, timeFormat, weekdayShortFormatter } from './utils/dateTime.js';
|
72
72
|
export { getIsMobile, getIsTouchDevice } from './utils/mobile.js';
|
73
|
-
export { debounce, genId, getAllScrollParents, getScrollParent, hasParent, isClientSide, isEqualObj, numberCompactFormatter, numberFormatter, percentCompactFormatter, throttle } from './utils/utils.js';
|
73
|
+
export { debounce, genId, getAllScrollParents, getScrollParent, hasParent, isClientSide, isEqualArr, isEqualObj, numberCompactFormatter, numberFormatter, percentCompactFormatter, throttle } from './utils/utils.js';
|
package/dist/utils/utils.d.ts
CHANGED
@@ -4,6 +4,7 @@ export declare const hasParent: (parent: Element, current: Element) => boolean;
|
|
4
4
|
type DebounceCb = (...args: any[]) => void;
|
5
5
|
export declare function debounce<T extends DebounceCb>(cb: T, delay?: number): T;
|
6
6
|
export declare function throttle<T extends DebounceCb>(cb: T, delay?: number): T;
|
7
|
+
export declare const isEqualArr: (arr1: unknown[], arr2: unknown[]) => boolean;
|
7
8
|
export declare const isEqualObj: (obj1: Record<string, unknown>, obj2: Record<string, unknown>, exclude?: string[]) => boolean;
|
8
9
|
export declare const percentCompactFormatter: Intl.NumberFormat;
|
9
10
|
export declare const numberCompactFormatter: Intl.NumberFormat;
|
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"utils.d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AC,CAYpE;AAED,eAAO,MAAM,UAAU,SAAU,OAAO,EAAE,QAAQ,OAAO,EAAE,KAAG,OAE7D,CAAA;AAED,eAAO,MAAM,UAAU,SAAU,OAAO,MAAM,EAAE,OAAO,CAAC,QAAQ,OAAO,MAAM,EAAE,OAAO,CAAC,YAAY,MAAM,EAAE,KAAG,OAS7G,CAAA;AAED,eAAO,MAAM,uBAAuB,mBAAmE,CAAA;AACvG,eAAO,MAAM,sBAAsB,mBAAiD,CAAA;AACpF,eAAO,MAAM,eAAe,mBAA0B,CAAA;AAEtD,eAAO,MAAM,YAAY,EAAE,OAAuC,CAAA;AAIlE,eAAO,MAAM,KAAK,cAEjB,CAAA"}
|
package/dist/utils/utils.js
CHANGED
@@ -46,8 +46,17 @@ function throttle(cb, delay = 200) {
|
|
46
46
|
}, delay);
|
47
47
|
};
|
48
48
|
}
|
49
|
+
const isEqualArr = (arr1, arr2) => {
|
50
|
+
return arr1.length === arr2.length && arr1.every((item) => arr2.includes(item));
|
51
|
+
};
|
49
52
|
const isEqualObj = (obj1, obj2, exclude) => {
|
50
|
-
return
|
53
|
+
return Object.keys({ ...obj1, ...obj2 }).every((key) => {
|
54
|
+
if (exclude?.includes(key) || obj1[key] === obj2[key])
|
55
|
+
return true;
|
56
|
+
if (Array.isArray(obj1[key]) && Array.isArray(obj2[key]))
|
57
|
+
return isEqualArr(obj1[key], obj2[key]);
|
58
|
+
return false;
|
59
|
+
});
|
51
60
|
};
|
52
61
|
const percentCompactFormatter = Intl.NumberFormat("en", { notation: "compact", style: "percent" });
|
53
62
|
const numberCompactFormatter = Intl.NumberFormat("en", { notation: "compact" });
|
@@ -58,4 +67,4 @@ const genId = () => {
|
|
58
67
|
return iterator++;
|
59
68
|
};
|
60
69
|
|
61
|
-
export { debounce, genId, getAllScrollParents, getScrollParent, hasParent, isClientSide, isEqualObj, numberCompactFormatter, numberFormatter, percentCompactFormatter, throttle };
|
70
|
+
export { debounce, genId, getAllScrollParents, getScrollParent, hasParent, isClientSide, isEqualArr, isEqualObj, numberCompactFormatter, numberFormatter, percentCompactFormatter, throttle };
|