cosey 0.4.4 → 0.4.5

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.
@@ -69,7 +69,6 @@ function useUpsert(options) {
69
69
  edit: async (_row) => {
70
70
  type.value = "edit";
71
71
  row.value = _row;
72
- console.log("initialModel", initialModel);
73
72
  deepAssign(unref(model), initialModel);
74
73
  visible.value = true;
75
74
  unref(show)?.(type.value, row.value);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "cosey",
3
- "version": "0.4.4",
3
+ "version": "0.4.5",
4
4
  "description": "基于 Vue3 + vite 的后台管理系统框架",
5
5
  "type": "module",
6
6
  "main": "index.js",
package/utils/object.d.ts CHANGED
@@ -18,7 +18,7 @@ export declare function uniformAssign<T extends object, Value>(object: T, value:
18
18
  */
19
19
  export declare function omitObject<T extends object, U extends object>(object: T, another: U): Pick<T, Exclude<keyof T, keyof U>>;
20
20
  /**
21
- * Object.assign 的深度操作,仅合并 plain 对象,可以被 undefined 覆盖。
21
+ * Object.assign 的深度操作,可以被 undefined 覆盖。
22
22
  */
23
23
  export declare function deepAssign<TObject extends object, TSource extends object>(object: TObject, source: TSource): TObject & TSource;
24
24
  export declare function deepAssign<TObject extends object, TSource1 extends object, TSource2 extends object>(object: TObject, source1: TSource1, source2: TSource2): TObject & TSource1 & TSource2;
package/utils/object.js CHANGED
@@ -1,5 +1,4 @@
1
- import { omit } from 'lodash-es';
2
- import { isPlainObject } from './is.js';
1
+ import { cloneDeep, omit } from 'lodash-es';
3
2
 
4
3
  function omitUndefined(object) {
5
4
  return Object.fromEntries(Object.entries(object).filter(([, value]) => value !== void 0));
@@ -22,10 +21,8 @@ function omitObject(object, another) {
22
21
  function deepAssign(object, ...sourceList) {
23
22
  sourceList.forEach((source) => {
24
23
  Object.keys(source).forEach((key) => {
25
- const tValue = object[key];
26
24
  const sValue = source[key];
27
- const value = isPlainObject(tValue) && isPlainObject(sValue) ? deepAssign(tValue, sValue) : sValue;
28
- object[key] = value;
25
+ object[key] = cloneDeep(sValue);
29
26
  });
30
27
  });
31
28
  return object;