@dazhicheng/utils 1.3.37 → 1.3.39

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/dist/tool.d.ts CHANGED
@@ -42,6 +42,20 @@ export declare function setDifferenceObj(keyObj: any, oldObj: any, v: any, k: an
42
42
  export declare function setDifferenceArr(keyObj: any, oldObj: any, v: any[], k: any, r: any): void;
43
43
  /** 脏数据检测方法--设置普通字段 */
44
44
  export declare function setDifferenceField(keyObj: any, oldObj: any, v: any[], k: any, r: any): void;
45
+ /**
46
+ * 对比两个对象的差异,返回差异的字段和值
47
+ * @param o - 原始对象
48
+ * @param n - 新对象
49
+ * @param option - 可选参数,包含排除的字段,排除字段不参与对比 e.g { excludeAll: [], exclude: [], xxx: { exclude: [] } }
50
+ * @param option.excludeAll - 全局排除的字段,所有对比都会排除这些字段
51
+ * @param option.exclude - 局部排除的字段,只有当前对比会排除这些字段
52
+ * @returns 差异的字段和值
53
+ */
54
+ export declare function compareObjects(o: Record<string, any>, n: Record<string, any>, option?: {
55
+ excludeAll?: string[];
56
+ exclude?: string[];
57
+ [k: string]: any;
58
+ }): Record<string, any>;
45
59
  export declare function deepMerge<T = any>(src?: any, target?: any): T;
46
60
  export declare function toCssUnit(val?: number | string, unit?: string): string;
47
61
  /** 响应式绑定 */
@@ -117,7 +131,7 @@ export declare function omit<T, TKeys extends keyof T>(obj: T, keys: TKeys[]): O
117
131
  */
118
132
  export declare function debounce<TArgs extends any[], TReturn = any>(func: (...args: TArgs) => TReturn, delay?: number, options?: DebounceSettings): DebounceFunction<TArgs, TReturn>;
119
133
  export type DebounceFunction<TArgs extends any[], TReturn = any> = {
120
- (...args: TArgs): TReturn;
134
+ (...args: TArgs): TReturn | undefined;
121
135
  /**
122
136
  * Cancels the debounced function
123
137
  */
@@ -129,5 +143,5 @@ export type DebounceFunction<TArgs extends any[], TReturn = any> = {
129
143
  /**
130
144
  * Runs the debounced function immediately
131
145
  */
132
- flush: (...args: TArgs) => TReturn;
146
+ flush: (...args: TArgs) => TReturn | undefined;
133
147
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@dazhicheng/utils",
3
- "version": "1.3.37",
3
+ "version": "1.3.39",
4
4
  "description": "工具库",
5
5
  "main": "./dist/index.esm.js",
6
6
  "type": "module",
@@ -51,13 +51,13 @@
51
51
  "defu": "^6.1.4",
52
52
  "klona": "^2.0.6",
53
53
  "tailwind-merge": "^3.5.0",
54
- "@dazhicheng/openapi": "1.1.10"
54
+ "@dazhicheng/openapi": "1.1.11"
55
55
  },
56
56
  "peerDependencies": {
57
- "axios": "^1.0.0",
58
- "element-plus": "^2.7.0",
59
- "lodash-es": "^4.0.0",
60
- "vue": "^3.5.0"
57
+ "axios": "^1.13.4",
58
+ "element-plus": "^2.13.7",
59
+ "lodash-es": "^4.17.23",
60
+ "vue": "^3.5.21"
61
61
  },
62
62
  "scripts": {
63
63
  "build": "rimraf dist && node ../../scripts/build.js utils",