@gx-design-vue/pro-utils 0.2.0-alpha.1 → 0.2.0-alpha.3

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.
Files changed (74) hide show
  1. package/dist/array/index.js +1 -2
  2. package/dist/array/slice.js +1 -3
  3. package/dist/array/sort.js +1 -3
  4. package/dist/array/tree.d.ts +2 -2
  5. package/dist/array/tree.js +1 -3
  6. package/dist/array/unique.js +1 -2
  7. package/dist/base64/index.js +1 -2
  8. package/dist/class/index.js +1 -2
  9. package/dist/class/prefix.js +1 -2
  10. package/dist/clone/cloneDeep.js +1 -3
  11. package/dist/clone/cloneDeepWith.js +1 -3
  12. package/dist/clone/getTag.js +1 -2
  13. package/dist/clone/index.js +1 -2
  14. package/dist/clone/symbols.js +1 -2
  15. package/dist/clone/tags.js +1 -2
  16. package/dist/dom/event.js +1 -2
  17. package/dist/dom/index.js +1 -2
  18. package/dist/dom/measure.js +1 -3
  19. package/dist/dom/raf.js +1 -2
  20. package/dist/dom/scroll.js +1 -3
  21. package/dist/file/config.js +6 -2
  22. package/dist/file/convert.js +1 -2
  23. package/dist/file/index.js +1 -2
  24. package/dist/file/media.js +1 -3
  25. package/dist/file/type.js +1 -3
  26. package/dist/function/copy.js +1 -2
  27. package/dist/function/getValue.js +1 -2
  28. package/dist/function/index.js +1 -2
  29. package/dist/function/object.js +1 -2
  30. package/dist/function/run.js +1 -2
  31. package/dist/index.d.ts +0 -7
  32. package/dist/index.js +2 -3
  33. package/dist/is/base64.js +1 -2
  34. package/dist/is/browser.js +1 -2
  35. package/dist/is/deepEqual.js +1 -2
  36. package/dist/is/device.js +1 -2
  37. package/dist/is/equal.js +1 -2
  38. package/dist/is/img.js +1 -2
  39. package/dist/is/index.js +1 -2
  40. package/dist/is/nil.js +1 -2
  41. package/dist/is/plainObject.js +1 -3
  42. package/dist/is/primitive.js +1 -2
  43. package/dist/is/server.js +1 -2
  44. package/dist/is/type.js +1 -2
  45. package/dist/is/typedArray.js +1 -2
  46. package/dist/is/unsafeProperty.js +1 -2
  47. package/dist/is/url.js +1 -2
  48. package/dist/is/valid.js +1 -2
  49. package/dist/merge/index.js +25 -7
  50. package/dist/merge/mergeWith.js +1 -3
  51. package/dist/merge/useDeepMege.js +1 -3
  52. package/dist/number/chinese.js +1 -3
  53. package/dist/number/format.js +1 -3
  54. package/dist/number/index.js +1 -2
  55. package/dist/object/classNames.js +1 -4
  56. package/dist/object/index.js +2 -3
  57. package/dist/object/omitBoolean.js +1 -2
  58. package/dist/object/omitUndefined.js +1 -2
  59. package/dist/object/omitUndefinedAndEmptyArr.js +1 -2
  60. package/dist/pro-utils.esm.js +366 -242
  61. package/dist/pro-utils.js +1 -1
  62. package/dist/string/duration.js +1 -2
  63. package/dist/string/empty.js +1 -2
  64. package/dist/string/index.js +1 -2
  65. package/dist/string/nanoid.js +1 -2
  66. package/dist/string/uuid.js +23 -2
  67. package/dist/table/column.js +4 -4
  68. package/dist/table/index.js +1 -2
  69. package/dist/table/page.js +1 -3
  70. package/dist/typing.js +1 -1
  71. package/dist/vue/index.js +1 -2
  72. package/dist/vue/slots.d.ts +2 -2
  73. package/dist/vue/slots.js +1 -3
  74. package/package.json +1 -1
@@ -2,5 +2,4 @@ import { arraySlice } from "./slice.js";
2
2
  import { compareArray, compareArraySort, compareArrayTimeSort, compareTime } from "./sort.js";
3
3
  import { filterTree, findSourceByTree, findValueAndAncestors, getArrayLast, getLevelData, getMaxFloor, getSortIndex, treeData } from "./tree.js";
4
4
  import { arrayUnique } from "./unique.js";
5
-
6
- export { arraySlice, arrayUnique, compareArray, compareArraySort, compareArrayTimeSort, compareTime, filterTree, findSourceByTree, findValueAndAncestors, getArrayLast, getLevelData, getMaxFloor, getSortIndex, treeData };
5
+ export { arraySlice, arrayUnique, compareArray, compareArraySort, compareArrayTimeSort, compareTime, filterTree, findSourceByTree, findValueAndAncestors, getArrayLast, getLevelData, getMaxFloor, getSortIndex, treeData };
@@ -1,6 +1,5 @@
1
1
  import { isArray, isNumber } from "../is/type.js";
2
2
  import "../is/index.js";
3
-
4
3
  //#region src/array/slice.ts
5
4
  /**
6
5
  * 数组切片,根据范围筛选数组元素
@@ -24,6 +23,5 @@ function arraySlice(data, range) {
24
23
  return true;
25
24
  });
26
25
  }
27
-
28
26
  //#endregion
29
- export { arraySlice };
27
+ export { arraySlice };
@@ -1,6 +1,5 @@
1
1
  import { isNumber } from "../is/type.js";
2
2
  import "../is/index.js";
3
-
4
3
  //#region src/array/sort.ts
5
4
  /**
6
5
  * 比较数组元素(用于排序)
@@ -60,6 +59,5 @@ function compareArraySort(dataSource, key, sort = 0) {
60
59
  function compareArrayTimeSort(dataSource, key, sort = 0) {
61
60
  return dataSource.sort((a, b) => compareTime(a, b, key, sort));
62
61
  }
63
-
64
62
  //#endregion
65
- export { compareArray, compareArraySort, compareArrayTimeSort, compareTime };
63
+ export { compareArray, compareArraySort, compareArrayTimeSort, compareTime };
@@ -48,8 +48,8 @@ declare function filterTree<T = any>(tree: T[], predicate: (val: T) => boolean):
48
48
  * @returns 祖先节点值数组
49
49
  */
50
50
  declare function findValueAndAncestors<T = any>(tree: T[], targetValue: any, fieldNames?: {
51
- value: 'value';
52
- children: 'children';
51
+ value: keyof T;
52
+ children: keyof T;
53
53
  }): any[];
54
54
  /**
55
55
  * 树形数组递归查找指定对象
@@ -1,6 +1,5 @@
1
1
  import { isArray, isObject } from "../is/type.js";
2
2
  import "../is/index.js";
3
-
4
3
  //#region src/array/tree.ts
5
4
  /**
6
5
  * 获取树形结构最深的层级数
@@ -152,6 +151,5 @@ function getSortIndex(data = [], pageConfig, childrenKey = "children") {
152
151
  return item;
153
152
  });
154
153
  }
155
-
156
154
  //#endregion
157
- export { filterTree, findSourceByTree, findValueAndAncestors, getArrayLast, getLevelData, getMaxFloor, getSortIndex, treeData };
155
+ export { filterTree, findSourceByTree, findValueAndAncestors, getArrayLast, getLevelData, getMaxFloor, getSortIndex, treeData };
@@ -9,6 +9,5 @@ function arrayUnique(data) {
9
9
  const set = new Set(data);
10
10
  return Array.from(set);
11
11
  }
12
-
13
12
  //#endregion
14
- export { arrayUnique };
13
+ export { arrayUnique };
@@ -101,6 +101,5 @@ var Base64 = class {
101
101
  return output;
102
102
  }
103
103
  };
104
-
105
104
  //#endregion
106
- export { Base64 as default };
105
+ export { Base64 as default };
@@ -1,3 +1,2 @@
1
1
  import { getPrefixCls } from "./prefix.js";
2
-
3
- export { getPrefixCls };
2
+ export { getPrefixCls };
@@ -10,6 +10,5 @@ function getPrefixCls({ suffixCls, customizePrefixCls, isPor, className }) {
10
10
  if (customizePrefixCls) return customizePrefixCls;
11
11
  return suffixCls ? `${prefixCls}-${suffixCls}` : prefixCls;
12
12
  }
13
-
14
13
  //#endregion
15
- export { getPrefixCls };
14
+ export { getPrefixCls };
@@ -1,5 +1,4 @@
1
1
  import { cloneDeepWithImpl } from "./cloneDeepWith.js";
2
-
3
2
  //#region src/clone/cloneDeep.ts
4
3
  /**
5
4
  * 深度克隆对象
@@ -30,6 +29,5 @@ import { cloneDeepWithImpl } from "./cloneDeepWith.js";
30
29
  function cloneDeep(obj) {
31
30
  return cloneDeepWithImpl(obj, void 0, obj, /* @__PURE__ */ new Map(), void 0);
32
31
  }
33
-
34
32
  //#endregion
35
- export { cloneDeep };
33
+ export { cloneDeep };
@@ -4,7 +4,6 @@ import "../is/index.js";
4
4
  import { getTag } from "./getTag.js";
5
5
  import { getSymbols } from "./symbols.js";
6
6
  import { argumentsTag, arrayBufferTag, arrayTag, booleanTag, dataViewTag, dateTag, float32ArrayTag, float64ArrayTag, int16ArrayTag, int32ArrayTag, int8ArrayTag, mapTag, numberTag, objectTag, regexpTag, setTag, stringTag, symbolTag, uint16ArrayTag, uint32ArrayTag, uint8ArrayTag, uint8ClampedArrayTag } from "./tags.js";
7
-
8
7
  //#region src/clone/cloneDeepWith.ts
9
8
  /**
10
9
  * 深度克隆对象(带自定义处理)
@@ -145,6 +144,5 @@ function isCloneableObject(object) {
145
144
  default: return false;
146
145
  }
147
146
  }
148
-
149
147
  //#endregion
150
- export { cloneDeepWith, cloneDeepWithImpl, copyProperties };
148
+ export { cloneDeepWith, cloneDeepWithImpl, copyProperties };
@@ -8,6 +8,5 @@
8
8
  function getTag(value) {
9
9
  return Object.prototype.toString.call(value);
10
10
  }
11
-
12
11
  //#endregion
13
- export { getTag };
12
+ export { getTag };
@@ -1,4 +1,3 @@
1
1
  import { cloneDeepWith, cloneDeepWithImpl, copyProperties } from "./cloneDeepWith.js";
2
2
  import { cloneDeep } from "./cloneDeep.js";
3
-
4
- export { cloneDeep, cloneDeepWith, cloneDeepWithImpl, copyProperties };
3
+ export { cloneDeep, cloneDeepWith, cloneDeepWithImpl, copyProperties };
@@ -8,6 +8,5 @@
8
8
  function getSymbols(object) {
9
9
  return Object.getOwnPropertySymbols(object);
10
10
  }
11
-
12
11
  //#endregion
13
- export { getSymbols };
12
+ export { getSymbols };
@@ -43,6 +43,5 @@ const uint8ClampedArrayTag = "[object Uint8ClampedArray]";
43
43
  const uint16ArrayTag = "[object Uint16Array]";
44
44
  /** Uint32 数组标签 */
45
45
  const uint32ArrayTag = "[object Uint32Array]";
46
-
47
46
  //#endregion
48
- export { argumentsTag, arrayBufferTag, arrayTag, booleanTag, dataViewTag, dateTag, float32ArrayTag, float64ArrayTag, int16ArrayTag, int32ArrayTag, int8ArrayTag, mapTag, numberTag, objectTag, regexpTag, setTag, stringTag, symbolTag, uint16ArrayTag, uint32ArrayTag, uint8ArrayTag, uint8ClampedArrayTag };
47
+ export { argumentsTag, arrayBufferTag, arrayTag, booleanTag, dataViewTag, dateTag, float32ArrayTag, float64ArrayTag, int16ArrayTag, int32ArrayTag, int8ArrayTag, mapTag, numberTag, objectTag, regexpTag, setTag, stringTag, symbolTag, uint16ArrayTag, uint32ArrayTag, uint8ArrayTag, uint8ClampedArrayTag };
package/dist/dom/event.js CHANGED
@@ -21,6 +21,5 @@ function on(element, event, handler, useCapture = false) {
21
21
  function off(element, event, handler, useCapture = false) {
22
22
  if (element && event && handler) element.removeEventListener(event, handler, useCapture);
23
23
  }
24
-
25
24
  //#endregion
26
- export { off, on };
25
+ export { off, on };
package/dist/dom/index.js CHANGED
@@ -2,5 +2,4 @@ import { off, on } from "./event.js";
2
2
  import { getTextWidth } from "./measure.js";
3
3
  import wrapperRaf from "./raf.js";
4
4
  import { easeInOutCubic, getScroll, getScrollContainer, isInContainer, isScroll, isWindow, scrollTo } from "./scroll.js";
5
-
6
- export { easeInOutCubic, getScroll, getScrollContainer, getTextWidth, isInContainer, isScroll, isWindow, off, on, wrapperRaf as raf, scrollTo };
5
+ export { easeInOutCubic, getScroll, getScrollContainer, getTextWidth, isInContainer, isScroll, isWindow, off, on, wrapperRaf as raf, scrollTo };
@@ -1,6 +1,5 @@
1
1
  import { isBoolean, isObject } from "../is/type.js";
2
2
  import "../is/index.js";
3
-
4
3
  //#region src/dom/measure.ts
5
4
  /**
6
5
  * 获取文字宽度或高度
@@ -37,6 +36,5 @@ function getTextWidth(str, options) {
37
36
  if (removeAfter) targetEl.removeChild(sourceEl);
38
37
  return number;
39
38
  }
40
-
41
39
  //#endregion
42
- export { getTextWidth };
40
+ export { getTextWidth };
package/dist/dom/raf.js CHANGED
@@ -39,6 +39,5 @@ wrapperRaf.cancel = (id) => {
39
39
  cleanup(realId);
40
40
  return caf(realId);
41
41
  };
42
-
43
42
  //#endregion
44
- export { wrapperRaf as default };
43
+ export { wrapperRaf as default };
@@ -1,7 +1,6 @@
1
1
  import { isServer } from "../is/server.js";
2
2
  import "../is/index.js";
3
3
  import wrapperRaf from "./raf.js";
4
-
5
4
  //#region src/dom/scroll.ts
6
5
  function easeInOutCubic(t, b, c, d) {
7
6
  const cc = c - b;
@@ -92,6 +91,5 @@ function scrollTo(y, options = {}) {
92
91
  };
93
92
  if (container) wrapperRaf(frameFunc);
94
93
  }
95
-
96
94
  //#endregion
97
- export { easeInOutCubic, getScroll, getScrollContainer, isInContainer, isScroll, isWindow, scrollTo };
95
+ export { easeInOutCubic, getScroll, getScrollContainer, isInContainer, isScroll, isWindow, scrollTo };
@@ -3,11 +3,13 @@
3
3
  * 文件类型配置
4
4
  */
5
5
  const fileTypes = {
6
+ /** 允许的视频格式 */
6
7
  videoAllowType: [
7
8
  "mp4",
8
9
  "webm",
9
10
  "ogg"
10
11
  ],
12
+ /** 允许的音频格式 */
11
13
  audioAllowType: [
12
14
  "mp3",
13
15
  "ogg",
@@ -16,6 +18,7 @@ const fileTypes = {
16
18
  "m4a",
17
19
  "webm"
18
20
  ],
21
+ /** 图片格式 */
19
22
  imageType: [
20
23
  "jpeg",
21
24
  "jpg",
@@ -37,6 +40,7 @@ const fileTypes = {
37
40
  "psd",
38
41
  "eps"
39
42
  ],
43
+ /** 视频格式 */
40
44
  videoType: [
41
45
  "mp4",
42
46
  "avi",
@@ -59,6 +63,7 @@ const fileTypes = {
59
63
  "divx",
60
64
  "xvid"
61
65
  ],
66
+ /** 音频格式 */
62
67
  audioType: [
63
68
  "mp3",
64
69
  "wav",
@@ -76,6 +81,5 @@ const fileTypes = {
76
81
  "ape"
77
82
  ]
78
83
  };
79
-
80
84
  //#endregion
81
- export { fileTypes };
85
+ export { fileTypes };
@@ -64,6 +64,5 @@ function dataURLtoFile(url, filename) {
64
64
  function blobToDataURL(blob, fileName, fileType) {
65
65
  return new window.File([blob], fileName, { type: fileType });
66
66
  }
67
-
68
67
  //#endregion
69
- export { blobToDataURL, dataURLtoBlob, dataURLtoFile, getBase64, getBlobUrl };
68
+ export { blobToDataURL, dataURLtoBlob, dataURLtoFile, getBase64, getBlobUrl };
@@ -2,5 +2,4 @@ import { fileTypes } from "./config.js";
2
2
  import { blobToDataURL, dataURLtoBlob, dataURLtoFile, getBase64, getBlobUrl } from "./convert.js";
3
3
  import { checkFileType, getFileSuffix, getVideoFileUrl } from "./type.js";
4
4
  import { generateVideoPicture, getMediaInfos, getVideoCoverPicture } from "./media.js";
5
-
6
- export { blobToDataURL, checkFileType, dataURLtoBlob, dataURLtoFile, fileTypes, generateVideoPicture, getBase64, getBlobUrl, getFileSuffix, getMediaInfos, getVideoCoverPicture, getVideoFileUrl };
5
+ export { blobToDataURL, checkFileType, dataURLtoBlob, dataURLtoFile, fileTypes, generateVideoPicture, getBase64, getBlobUrl, getFileSuffix, getMediaInfos, getVideoCoverPicture, getVideoFileUrl };
@@ -2,7 +2,6 @@ import { isBase64 } from "../is/base64.js";
2
2
  import "../is/index.js";
3
3
  import { fileTypes } from "./config.js";
4
4
  import { checkFileType, getFileSuffix } from "./type.js";
5
-
6
5
  //#region src/file/media.ts
7
6
  /**
8
7
  * 获取媒体信息(图片/视频/音频)
@@ -156,6 +155,5 @@ async function generateVideoPicture(videoUrl, currentTime = 0) {
156
155
  }
157
156
  });
158
157
  }
159
-
160
158
  //#endregion
161
- export { generateVideoPicture, getMediaInfos, getVideoCoverPicture };
159
+ export { generateVideoPicture, getMediaInfos, getVideoCoverPicture };
package/dist/file/type.js CHANGED
@@ -1,7 +1,6 @@
1
1
  import { isBase64 } from "../is/base64.js";
2
2
  import "../is/index.js";
3
3
  import { fileTypes } from "./config.js";
4
-
5
4
  //#region src/file/type.ts
6
5
  /**
7
6
  * 获取文件后缀名
@@ -53,6 +52,5 @@ function checkFileType(url, type) {
53
52
  if (fileTypes.audioType.includes(fileType)) return "2";
54
53
  return "4";
55
54
  }
56
-
57
55
  //#endregion
58
- export { checkFileType, getFileSuffix, getVideoFileUrl };
56
+ export { checkFileType, getFileSuffix, getVideoFileUrl };
@@ -8,6 +8,5 @@
8
8
  function deepCopy(data) {
9
9
  return JSON.parse(JSON.stringify(data));
10
10
  }
11
-
12
11
  //#endregion
13
- export { deepCopy };
12
+ export { deepCopy };
@@ -14,6 +14,5 @@ function getValueFromObjectByKey(object, key) {
14
14
  else return;
15
15
  return currentValue;
16
16
  }
17
-
18
17
  //#endregion
19
- export { getValueFromObjectByKey };
18
+ export { getValueFromObjectByKey };
@@ -2,5 +2,4 @@ import { forInObject, getSymbols, keysOf } from "./object.js";
2
2
  import { deepCopy } from "./copy.js";
3
3
  import { getValueFromObjectByKey } from "./getValue.js";
4
4
  import { runFunction } from "./run.js";
5
-
6
- export { deepCopy, forInObject, getSymbols, getValueFromObjectByKey, keysOf, runFunction };
5
+ export { deepCopy, forInObject, getSymbols, getValueFromObjectByKey, keysOf, runFunction };
@@ -28,6 +28,5 @@ function forInObject(obj, callback) {
28
28
  function keysOf(obj) {
29
29
  return Object.keys(obj);
30
30
  }
31
-
32
31
  //#endregion
33
- export { forInObject, getSymbols, keysOf };
32
+ export { forInObject, getSymbols, keysOf };
@@ -10,6 +10,5 @@ function runFunction(valueEnum, ...rest) {
10
10
  if (typeof valueEnum === "function") return valueEnum(...rest);
11
11
  return valueEnum;
12
12
  }
13
-
14
13
  //#endregion
15
- export { runFunction };
14
+ export { runFunction };
package/dist/index.d.ts CHANGED
@@ -3,7 +3,6 @@ import { compareArray, compareArraySort, compareArrayTimeSort, compareTime } fro
3
3
  import { AlignType, BasicTablePageConfig, Breakpoint, CustomRender, DeepPartial, EmptyEmit, ExtendIfDefined, Fn, LimitDeepPartial, MediaOptions, Nullable, OmitUndefined, RecordType, SemanticClassNames, SemanticStyles, SizeType, VueNode, WithFalse, WithIfDefault, WithRequired } from "./typing.js";
4
4
  import { filterTree, findSourceByTree, findValueAndAncestors, getArrayLast, getLevelData, getMaxFloor, getSortIndex, treeData } from "./array/tree.js";
5
5
  import { arrayUnique } from "./array/unique.js";
6
- import "./array/index.js";
7
6
  import { PrefixCls, getPrefixCls } from "./class/prefix.js";
8
7
  import { cloneDeep } from "./clone/cloneDeep.js";
9
8
  import { cloneDeepWith, cloneDeepWithImpl, copyProperties } from "./clone/cloneDeepWith.js";
@@ -11,17 +10,14 @@ import { off, on } from "./dom/event.js";
11
10
  import { getTextWidth } from "./dom/measure.js";
12
11
  import wrapperRaf from "./dom/raf.js";
13
12
  import { ScrollToOptions, easeInOutCubic, getScroll, getScrollContainer, isInContainer, isScroll, isWindow, scrollTo } from "./dom/scroll.js";
14
- import "./dom/index.js";
15
13
  import { fileTypes } from "./file/config.js";
16
14
  import { blobToDataURL, dataURLtoBlob, dataURLtoFile, getBase64, getBlobUrl } from "./file/convert.js";
17
15
  import { generateVideoPicture, getMediaInfos, getVideoCoverPicture } from "./file/media.js";
18
16
  import { checkFileType, getFileSuffix, getVideoFileUrl } from "./file/type.js";
19
- import "./file/index.js";
20
17
  import { deepCopy } from "./function/copy.js";
21
18
  import { getValueFromObjectByKey } from "./function/getValue.js";
22
19
  import { forInObject, getSymbols, keysOf } from "./function/object.js";
23
20
  import { runFunction } from "./function/run.js";
24
- import "./function/index.js";
25
21
  import { isBase64, isDataURLBase64 } from "./is/base64.js";
26
22
  import { isBrowser } from "./is/browser.js";
27
23
  import { isDeepEqualReact } from "./is/deepEqual.js";
@@ -46,14 +42,11 @@ import classNames from "./object/classNames.js";
46
42
  import { omitBoolean } from "./object/omitBoolean.js";
47
43
  import { omitUndefined } from "./object/omitUndefined.js";
48
44
  import { omitUndefinedAndEmptyArr } from "./object/omitUndefinedAndEmptyArr.js";
49
- import "./object/index.js";
50
45
  import { formatDuration } from "./string/duration.js";
51
46
  import { handleEmptyField } from "./string/empty.js";
52
47
  import { nanoid } from "./string/nanoid.js";
53
48
  import { getRandomNumber } from "./string/uuid.js";
54
49
  import { genColumnKey, handleShowIndex } from "./table/column.js";
55
50
  import { handleCurrentPage } from "./table/page.js";
56
- import "./table/index.js";
57
51
  import { RenderResult, SlotsPropsResult, filterEmpty, getKeys, getSlot, getSlotVNode, getSlotsChildren, getSlotsProps, isEmptyElement, slotRender } from "./vue/slots.js";
58
- import "./vue/index.js";
59
52
  export { AlignType, BasicTablePageConfig, Breakpoint, CustomRender, DeepPartial, EmptyEmit, ExtendIfDefined, Fn, LimitDeepPartial, MediaOptions, Nullable, OmitUndefined, PrefixCls, RecordType, RenderResult, ScrollToOptions, SemanticClassNames, SemanticStyles, SizeType, SlotsPropsResult, VueNode, WithFalse, WithIfDefault, WithRequired, arraySlice, arrayUnique, blobToDataURL, checkFileType, classNames, cloneDeep, cloneDeepWith, cloneDeepWithImpl, compareArray, compareArraySort, compareArrayTimeSort, compareTime, convertValueBoolean, copyProperties, dataURLtoBlob, dataURLtoFile, deepCopy, deepMerge, easeInOutCubic, fileTypes, filterEmpty, filterTree, findSourceByTree, findValueAndAncestors, forInObject, formatDuration, formatNumber, genColumnKey, generateVideoPicture, getArrayLast, getBase64, getBlobUrl, getFileSuffix, getKeys, getLevelData, getMaxFloor, getMediaInfos, getPrefixCls, getRandomNumber, getScroll, getScrollContainer, getSlot, getSlotVNode, getSlotsChildren, getSlotsProps, getSortIndex, getSymbols, getTextWidth, getValueFromObjectByKey, getVideoCoverPicture, getVideoFileUrl, handleCurrentPage, handleEmptyField, handleShowIndex, is, isArray, isBase64, isBoolean, isBrowser, isDataURLBase64, isDeepEqualReact, isEmptyElement, isEqual, isFunction, isImg, isInContainer, isJSONStr, isMobile, isNil, isNotNil, isNumber, isObject, isObjectWithSymbols, isPlainObject, isPrimitive, isScroll, isServer, isString, isTablet, isTypedArray, isUnsafeProperty, isUrl, isValid, isWindow, isWindowsOs, keysOf, merge, mergeWith, nanoid, off, omitBoolean, omitUndefined, omitUndefinedAndEmptyArr, on, wrapperRaf as raf, runFunction, scrollTo, slotRender, toChinesNum, toConvertNumberShow, treeData, useDeepMerge };
package/dist/index.js CHANGED
@@ -43,7 +43,7 @@ import { deepMerge, merge } from "./merge/index.js";
43
43
  import { toChinesNum } from "./number/chinese.js";
44
44
  import { formatNumber, toConvertNumberShow } from "./number/format.js";
45
45
  import "./number/index.js";
46
- import classNames_default from "./object/classNames.js";
46
+ import classNames from "./object/classNames.js";
47
47
  import { omitBoolean } from "./object/omitBoolean.js";
48
48
  import { omitUndefined } from "./object/omitUndefined.js";
49
49
  import { omitUndefinedAndEmptyArr } from "./object/omitUndefinedAndEmptyArr.js";
@@ -57,5 +57,4 @@ import { handleCurrentPage } from "./table/page.js";
57
57
  import "./table/index.js";
58
58
  import { filterEmpty, getKeys, getSlot, getSlotVNode, getSlotsChildren, getSlotsProps, isEmptyElement, slotRender } from "./vue/slots.js";
59
59
  import "./vue/index.js";
60
-
61
- export { arraySlice, arrayUnique, blobToDataURL, checkFileType, classNames_default as classNames, cloneDeep, cloneDeepWith, cloneDeepWithImpl, compareArray, compareArraySort, compareArrayTimeSort, compareTime, convertValueBoolean, copyProperties, dataURLtoBlob, dataURLtoFile, deepCopy, deepMerge, easeInOutCubic, fileTypes, filterEmpty, filterTree, findSourceByTree, findValueAndAncestors, forInObject, formatDuration, formatNumber, genColumnKey, generateVideoPicture, getArrayLast, getBase64, getBlobUrl, getFileSuffix, getKeys, getLevelData, getMaxFloor, getMediaInfos, getPrefixCls, getRandomNumber, getScroll, getScrollContainer, getSlot, getSlotVNode, getSlotsChildren, getSlotsProps, getSortIndex, getSymbols, getTextWidth, getValueFromObjectByKey, getVideoCoverPicture, getVideoFileUrl, handleCurrentPage, handleEmptyField, handleShowIndex, is, isArray, isBase64, isBoolean, isBrowser, isDataURLBase64, isDeepEqualReact, isEmptyElement, isEqual, isFunction, isImg, isInContainer, isJSONStr, isMobile, isNil, isNotNil, isNumber, isObject, isObjectWithSymbols, isPlainObject, isPrimitive, isScroll, isServer, isString, isTablet, isTypedArray, isUnsafeProperty, isUrl, isValid, isWindow, isWindowsOs, keysOf, merge, mergeWith, nanoid, off, omitBoolean, omitUndefined, omitUndefinedAndEmptyArr, on, wrapperRaf as raf, runFunction, scrollTo, slotRender, toChinesNum, toConvertNumberShow, treeData, useDeepMerge };
60
+ export { arraySlice, arrayUnique, blobToDataURL, checkFileType, classNames, cloneDeep, cloneDeepWith, cloneDeepWithImpl, compareArray, compareArraySort, compareArrayTimeSort, compareTime, convertValueBoolean, copyProperties, dataURLtoBlob, dataURLtoFile, deepCopy, deepMerge, easeInOutCubic, fileTypes, filterEmpty, filterTree, findSourceByTree, findValueAndAncestors, forInObject, formatDuration, formatNumber, genColumnKey, generateVideoPicture, getArrayLast, getBase64, getBlobUrl, getFileSuffix, getKeys, getLevelData, getMaxFloor, getMediaInfos, getPrefixCls, getRandomNumber, getScroll, getScrollContainer, getSlot, getSlotVNode, getSlotsChildren, getSlotsProps, getSortIndex, getSymbols, getTextWidth, getValueFromObjectByKey, getVideoCoverPicture, getVideoFileUrl, handleCurrentPage, handleEmptyField, handleShowIndex, is, isArray, isBase64, isBoolean, isBrowser, isDataURLBase64, isDeepEqualReact, isEmptyElement, isEqual, isFunction, isImg, isInContainer, isJSONStr, isMobile, isNil, isNotNil, isNumber, isObject, isObjectWithSymbols, isPlainObject, isPrimitive, isScroll, isServer, isString, isTablet, isTypedArray, isUnsafeProperty, isUrl, isValid, isWindow, isWindowsOs, keysOf, merge, mergeWith, nanoid, off, omitBoolean, omitUndefined, omitUndefinedAndEmptyArr, on, wrapperRaf as raf, runFunction, scrollTo, slotRender, toChinesNum, toConvertNumberShow, treeData, useDeepMerge };
package/dist/is/base64.js CHANGED
@@ -22,6 +22,5 @@ function isBase64(str = "") {
22
22
  function isDataURLBase64(str) {
23
23
  return typeof str === "string" && /^data:(?:image|video|audio)\/[A-Za-z]+;base64,[A-Za-z0-9+/=]+$/.test(str);
24
24
  }
25
-
26
25
  //#endregion
27
- export { isBase64, isDataURLBase64 };
26
+ export { isBase64, isDataURLBase64 };
@@ -9,6 +9,5 @@ function isBrowser() {
9
9
  if (process.env.NODE_ENV === "TEST") return true;
10
10
  return typeof window !== "undefined" && typeof window.document !== "undefined" && typeof window.matchMedia !== "undefined" && !isNode;
11
11
  }
12
-
13
12
  //#endregion
14
- export { isBrowser };
13
+ export { isBrowser };
@@ -57,6 +57,5 @@ function isDeepEqualReact(a, b, ignoreKeys, debug) {
57
57
  }
58
58
  return a !== a && b !== b;
59
59
  }
60
-
61
60
  //#endregion
62
- export { isDeepEqualReact };
61
+ export { isDeepEqualReact };
package/dist/is/device.js CHANGED
@@ -32,6 +32,5 @@ function isTablet() {
32
32
  function isWindowsOs() {
33
33
  return /windows|win32/i.test(navigator.userAgent);
34
34
  }
35
-
36
35
  //#endregion
37
- export { isMobile, isTablet, isWindowsOs };
36
+ export { isMobile, isTablet, isWindowsOs };
package/dist/is/equal.js CHANGED
@@ -29,6 +29,5 @@ function isEqual(obj1, obj2, shallow = false) {
29
29
  }
30
30
  return deepEqual(obj1, obj2);
31
31
  }
32
-
33
32
  //#endregion
34
- export { isEqual };
33
+ export { isEqual };
package/dist/is/img.js CHANGED
@@ -8,6 +8,5 @@
8
8
  function isImg(path) {
9
9
  return /\w.(?:png|jpg|jpeg|svg|webp|gif|bmp)$/i.test(path);
10
10
  }
11
-
12
11
  //#endregion
13
- export { isImg };
12
+ export { isImg };
package/dist/is/index.js CHANGED
@@ -13,5 +13,4 @@ import { isTypedArray } from "./typedArray.js";
13
13
  import { isUnsafeProperty } from "./unsafeProperty.js";
14
14
  import { isUrl } from "./url.js";
15
15
  import { convertValueBoolean, isValid } from "./valid.js";
16
-
17
- export { convertValueBoolean, is, isArray, isBase64, isBoolean, isBrowser, isDataURLBase64, isDeepEqualReact, isEqual, isFunction, isImg, isJSONStr, isMobile, isNil, isNotNil, isNumber, isObject, isObjectWithSymbols, isPlainObject, isPrimitive, isServer, isString, isTablet, isTypedArray, isUnsafeProperty, isUrl, isValid, isWindowsOs };
16
+ export { convertValueBoolean, is, isArray, isBase64, isBoolean, isBrowser, isDataURLBase64, isDeepEqualReact, isEqual, isFunction, isImg, isJSONStr, isMobile, isNil, isNotNil, isNumber, isObject, isObjectWithSymbols, isPlainObject, isPrimitive, isServer, isString, isTablet, isTypedArray, isUnsafeProperty, isUrl, isValid, isWindowsOs };
package/dist/is/nil.js CHANGED
@@ -17,6 +17,5 @@ function isNil(val) {
17
17
  function isNotNil(val) {
18
18
  return val !== null && val !== void 0;
19
19
  }
20
-
21
20
  //#endregion
22
- export { isNil, isNotNil };
21
+ export { isNil, isNotNil };
@@ -1,6 +1,5 @@
1
1
  import { getSymbols } from "../function/object.js";
2
2
  import { isObject } from "./type.js";
3
-
4
3
  //#region src/is/plainObject.ts
5
4
  /**
6
5
  * 判断是否为纯对象(plain object)
@@ -25,6 +24,5 @@ function isObjectWithSymbols(value) {
25
24
  if (!isObject(value)) return false;
26
25
  return getSymbols(value).length > 0;
27
26
  }
28
-
29
27
  //#endregion
30
- export { isObjectWithSymbols, isPlainObject };
28
+ export { isObjectWithSymbols, isPlainObject };
@@ -8,6 +8,5 @@
8
8
  function isPrimitive(value) {
9
9
  return value === null || typeof value !== "object" && typeof value !== "function";
10
10
  }
11
-
12
11
  //#endregion
13
- export { isPrimitive };
12
+ export { isPrimitive };
package/dist/is/server.js CHANGED
@@ -5,6 +5,5 @@
5
5
  * @returns 是否为服务端
6
6
  */
7
7
  const isServer = typeof window === "undefined";
8
-
9
8
  //#endregion
10
- export { isServer };
9
+ export { isServer };
package/dist/is/type.js CHANGED
@@ -79,6 +79,5 @@ function isJSONStr(str) {
79
79
  return false;
80
80
  }
81
81
  }
82
-
83
82
  //#endregion
84
- export { is, isArray, isBoolean, isFunction, isJSONStr, isNumber, isObject, isString };
83
+ export { is, isArray, isBoolean, isFunction, isJSONStr, isNumber, isObject, isString };
@@ -28,6 +28,5 @@
28
28
  function isTypedArray(x) {
29
29
  return ArrayBuffer.isView(x) && !(x instanceof DataView);
30
30
  }
31
-
32
31
  //#endregion
33
- export { isTypedArray };
32
+ export { isTypedArray };
@@ -13,6 +13,5 @@ function isUnsafeProperty(property) {
13
13
  "prototype"
14
14
  ].includes(property);
15
15
  }
16
-
17
16
  //#endregion
18
- export { isUnsafeProperty };
17
+ export { isUnsafeProperty };
package/dist/is/url.js CHANGED
@@ -15,6 +15,5 @@ function isUrl(path) {
15
15
  return false;
16
16
  }
17
17
  }
18
-
19
18
  //#endregion
20
- export { isUrl };
19
+ export { isUrl };
package/dist/is/valid.js CHANGED
@@ -18,6 +18,5 @@ function convertValueBoolean(value) {
18
18
  if (typeof value === "boolean") return value;
19
19
  return !!value;
20
20
  }
21
-
22
21
  //#endregion
23
- export { convertValueBoolean, isValid };
22
+ export { convertValueBoolean, isValid };
@@ -4,7 +4,6 @@ import { cloneDeep } from "../clone/cloneDeep.js";
4
4
  import "../clone/index.js";
5
5
  import { mergeWith } from "./mergeWith.js";
6
6
  import { useDeepMerge } from "./useDeepMege.js";
7
-
8
7
  //#region src/merge/index.ts
9
8
  /**
10
9
  * 合并多个对象
@@ -17,7 +16,7 @@ function merge(...rest) {
17
16
  const il = rest.length;
18
17
  let key;
19
18
  let i = 0;
20
- for (; i < il; i += 1) for (key in rest[i]) if (Object.prototype.hasOwnProperty.call(rest[i], key)) if (typeof obj[key] === "object" && typeof rest[i][key] === "object" && obj[key] !== void 0 && obj[key] !== null && !Array.isArray(obj[key]) && !Array.isArray(rest[i][key])) obj[key] = {
19
+ for (; i < il; i += 1) for (key in rest[i]) if (Object.getOwnPropertyDescriptor(rest[i], key)) if (typeof obj[key] === "object" && typeof rest[i][key] === "object" && obj[key] !== void 0 && obj[key] !== null && !Array.isArray(obj[key]) && !Array.isArray(rest[i][key])) obj[key] = {
21
20
  ...obj[key],
22
21
  ...rest[i][key]
23
22
  };
@@ -32,11 +31,30 @@ function merge(...rest) {
32
31
  * @returns 合并后的对象
33
32
  */
34
33
  function deepMerge(target, source) {
35
- return mergeWith(cloneDeep(target), source, function mergeRecursively(targetValue, sourceValue) {
36
- if (isPlainObject(sourceValue)) if (isPlainObject(targetValue)) return mergeWith(cloneDeep(targetValue), sourceValue, mergeRecursively);
37
- else return mergeWith({}, sourceValue, mergeRecursively);
34
+ const sourceStack = /* @__PURE__ */ new WeakMap();
35
+ const clonedTarget = cloneDeep(target);
36
+ if (isPlainObject(source)) sourceStack.set(source, clonedTarget);
37
+ const mergedTarget = mergeWith(clonedTarget, source, function mergeRecursively(targetValue, sourceValue) {
38
+ if (isPlainObject(sourceValue)) {
39
+ const cached = sourceStack.get(sourceValue);
40
+ if (cached) return cached;
41
+ if (isPlainObject(targetValue)) {
42
+ const nextTarget = cloneDeep(targetValue);
43
+ sourceStack.set(sourceValue, nextTarget);
44
+ const merged = mergeWith(nextTarget, sourceValue, mergeRecursively);
45
+ sourceStack.delete(sourceValue);
46
+ return merged;
47
+ } else {
48
+ const nextTarget = {};
49
+ sourceStack.set(sourceValue, nextTarget);
50
+ const merged = mergeWith(nextTarget, sourceValue, mergeRecursively);
51
+ sourceStack.delete(sourceValue);
52
+ return merged;
53
+ }
54
+ }
38
55
  });
56
+ if (isPlainObject(source)) sourceStack.delete(source);
57
+ return mergedTarget;
39
58
  }
40
-
41
59
  //#endregion
42
- export { deepMerge, merge, mergeWith, useDeepMerge };
60
+ export { deepMerge, merge, mergeWith, useDeepMerge };