@v-c/util 0.0.13 → 0.0.15

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 (112) hide show
  1. package/dist/Children/isFragment.cjs +2 -4
  2. package/dist/Children/isFragment.js +3 -5
  3. package/dist/Children/toArray.cjs +10 -17
  4. package/dist/Children/toArray.js +10 -17
  5. package/dist/Dom/addEventListener.cjs +5 -10
  6. package/dist/Dom/addEventListener.js +6 -11
  7. package/dist/Dom/canUseDom.cjs +2 -3
  8. package/dist/Dom/canUseDom.js +2 -4
  9. package/dist/Dom/class.cjs +6 -20
  10. package/dist/Dom/class.js +7 -23
  11. package/dist/Dom/contains.cjs +9 -13
  12. package/dist/Dom/contains.js +9 -14
  13. package/dist/Dom/css.cjs +51 -66
  14. package/dist/Dom/css.js +52 -74
  15. package/dist/Dom/dynamicCSS.cjs +59 -86
  16. package/dist/Dom/dynamicCSS.js +58 -88
  17. package/dist/Dom/findDOMNode.cjs +7 -10
  18. package/dist/Dom/findDOMNode.js +6 -11
  19. package/dist/Dom/focus.cjs +36 -43
  20. package/dist/Dom/focus.js +37 -48
  21. package/dist/Dom/isVisible.cjs +16 -21
  22. package/dist/Dom/isVisible.js +15 -21
  23. package/dist/Dom/scrollLocker.cjs +66 -88
  24. package/dist/Dom/scrollLocker.js +64 -87
  25. package/dist/Dom/shadow.cjs +3 -5
  26. package/dist/Dom/shadow.js +4 -7
  27. package/dist/Dom/styleChecker.cjs +14 -18
  28. package/dist/Dom/styleChecker.js +14 -18
  29. package/dist/Dom/support.cjs +14 -22
  30. package/dist/Dom/support.js +12 -21
  31. package/dist/EventInterface.cjs +0 -1
  32. package/dist/EventInterface.js +0 -1
  33. package/dist/KeyCode.cjs +165 -522
  34. package/dist/KeyCode.js +164 -522
  35. package/dist/Portal.cjs +40 -46
  36. package/dist/Portal.js +37 -45
  37. package/dist/PortalWrapper.cjs +130 -164
  38. package/dist/PortalWrapper.js +126 -163
  39. package/dist/classnames.cjs +30 -38
  40. package/dist/classnames.js +30 -40
  41. package/dist/composeProps.cjs +15 -17
  42. package/dist/composeProps.js +14 -17
  43. package/dist/createRef.cjs +14 -16
  44. package/dist/createRef.js +13 -18
  45. package/dist/debug/diff.cjs +39 -45
  46. package/dist/debug/diff.js +39 -46
  47. package/dist/deprecated.cjs +2 -7
  48. package/dist/deprecated.js +2 -8
  49. package/dist/getScrollBarSize.cjs +39 -43
  50. package/dist/getScrollBarSize.js +39 -45
  51. package/dist/guid.cjs +3 -4
  52. package/dist/guid.js +3 -5
  53. package/dist/hooks/useEvent.cjs +2 -3
  54. package/dist/hooks/useEvent.js +2 -4
  55. package/dist/hooks/useId.cjs +10 -15
  56. package/dist/hooks/useId.js +9 -15
  57. package/dist/hooks/useLayoutEffect.cjs +29 -52
  58. package/dist/hooks/useLayoutEffect.js +30 -54
  59. package/dist/hooks/useMemo.cjs +9 -13
  60. package/dist/hooks/useMemo.js +8 -13
  61. package/dist/hooks/useMergedState.cjs +22 -27
  62. package/dist/hooks/useMergedState.js +22 -28
  63. package/dist/hooks/useMobile.cjs +13 -13
  64. package/dist/hooks/useMobile.js +12 -14
  65. package/dist/hooks/useState.cjs +7 -9
  66. package/dist/hooks/useState.js +6 -9
  67. package/dist/index.cjs +9 -11
  68. package/dist/index.js +5 -11
  69. package/dist/isEqual.cjs +26 -34
  70. package/dist/isEqual.js +25 -34
  71. package/dist/isMobile.cjs +6 -12
  72. package/dist/isMobile.js +5 -12
  73. package/dist/isValid.cjs +4 -4
  74. package/dist/isValid.js +3 -4
  75. package/dist/omit.cjs +6 -9
  76. package/dist/omit.js +6 -10
  77. package/dist/pickAttrs.cjs +20 -36
  78. package/dist/pickAttrs.js +20 -37
  79. package/dist/props-util/index.cjs +35 -52
  80. package/dist/props-util/index.js +35 -57
  81. package/dist/raf.cjs +34 -37
  82. package/dist/raf.js +33 -38
  83. package/dist/setStyle.cjs +14 -15
  84. package/dist/setStyle.js +13 -15
  85. package/dist/switchScrollingEffect.cjs +29 -35
  86. package/dist/switchScrollingEffect.js +27 -34
  87. package/dist/test/domHook.cjs +32 -46
  88. package/dist/test/domHook.js +33 -48
  89. package/dist/type.cjs +36 -17
  90. package/dist/type.d.ts +1 -1
  91. package/dist/type.js +38 -30
  92. package/dist/utils/checkSlotProp.cjs +6 -10
  93. package/dist/utils/checkSlotProp.js +7 -11
  94. package/dist/utils/get.cjs +7 -9
  95. package/dist/utils/get.js +7 -10
  96. package/dist/utils/omit.cjs +5 -7
  97. package/dist/utils/omit.js +6 -8
  98. package/dist/utils/set.cjs +37 -51
  99. package/dist/utils/set.js +36 -53
  100. package/dist/utils/transition.cjs +76 -80
  101. package/dist/utils/transition.d.ts +2 -2
  102. package/dist/utils/transition.js +76 -84
  103. package/dist/utils/watchState.cjs +12 -14
  104. package/dist/utils/watchState.js +13 -16
  105. package/dist/vnode.cjs +48 -39
  106. package/dist/vnode.d.ts +1 -0
  107. package/dist/vnode.js +47 -43
  108. package/dist/vueuse/unref-element.cjs +3 -5
  109. package/dist/vueuse/unref-element.js +3 -5
  110. package/dist/warning.cjs +21 -29
  111. package/dist/warning.js +20 -36
  112. package/package.json +1 -1
@@ -1,38 +1,32 @@
1
- "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
3
- const getScrollBarSize = require("./getScrollBarSize.cjs");
4
- const setStyle = require("./setStyle.cjs");
1
+ Object.defineProperty(exports, "__esModule", { value: true });
2
+ const require_getScrollBarSize = require("./getScrollBarSize.cjs");
3
+ const require_setStyle = require("./setStyle.cjs");
5
4
  function isBodyOverflowing() {
6
- return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth;
5
+ return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth;
7
6
  }
8
- let cacheStyle = {};
9
- const switchScrollingEffect = (close) => {
10
- if (!isBodyOverflowing() && !close)
11
- return;
12
- const scrollingEffectClassName = "ant-scrolling-effect";
13
- const scrollingEffectClassNameReg = new RegExp(
14
- `${scrollingEffectClassName}`,
15
- "g"
16
- );
17
- const bodyClassName = document.body.className;
18
- if (close) {
19
- if (!scrollingEffectClassNameReg.test(bodyClassName))
20
- return;
21
- setStyle.default(cacheStyle);
22
- cacheStyle = {};
23
- document.body.className = bodyClassName.replace(scrollingEffectClassNameReg, "").trim();
24
- return;
25
- }
26
- const scrollBarSize = getScrollBarSize.default();
27
- if (scrollBarSize) {
28
- cacheStyle = setStyle.default({
29
- position: "relative",
30
- width: `calc(100% - ${scrollBarSize}px)`
31
- });
32
- if (!scrollingEffectClassNameReg.test(bodyClassName)) {
33
- const addClassName = `${bodyClassName} ${scrollingEffectClassName}`;
34
- document.body.className = addClassName.trim();
35
- }
36
- }
7
+ var cacheStyle = {};
8
+ var switchScrollingEffect_default = (close) => {
9
+ if (!isBodyOverflowing() && !close) return;
10
+ const scrollingEffectClassName = "ant-scrolling-effect";
11
+ const scrollingEffectClassNameReg = new RegExp(`${scrollingEffectClassName}`, "g");
12
+ const bodyClassName = document.body.className;
13
+ if (close) {
14
+ if (!scrollingEffectClassNameReg.test(bodyClassName)) return;
15
+ require_setStyle.default(cacheStyle);
16
+ cacheStyle = {};
17
+ document.body.className = bodyClassName.replace(scrollingEffectClassNameReg, "").trim();
18
+ return;
19
+ }
20
+ const scrollBarSize = require_getScrollBarSize.default();
21
+ if (scrollBarSize) {
22
+ cacheStyle = require_setStyle.default({
23
+ position: "relative",
24
+ width: `calc(100% - ${scrollBarSize}px)`
25
+ });
26
+ if (!scrollingEffectClassNameReg.test(bodyClassName)) {
27
+ const addClassName = `${bodyClassName} ${scrollingEffectClassName}`;
28
+ document.body.className = addClassName.trim();
29
+ }
30
+ }
37
31
  };
38
- exports.default = switchScrollingEffect;
32
+ exports.default = switchScrollingEffect_default;
@@ -1,38 +1,31 @@
1
1
  import getScrollBarSize from "./getScrollBarSize.js";
2
- import setStyle from "./setStyle.js";
2
+ import setStyle_default from "./setStyle.js";
3
3
  function isBodyOverflowing() {
4
- return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth;
4
+ return document.body.scrollHeight > (window.innerHeight || document.documentElement.clientHeight) && window.innerWidth > document.body.offsetWidth;
5
5
  }
6
- let cacheStyle = {};
7
- const switchScrollingEffect = (close) => {
8
- if (!isBodyOverflowing() && !close)
9
- return;
10
- const scrollingEffectClassName = "ant-scrolling-effect";
11
- const scrollingEffectClassNameReg = new RegExp(
12
- `${scrollingEffectClassName}`,
13
- "g"
14
- );
15
- const bodyClassName = document.body.className;
16
- if (close) {
17
- if (!scrollingEffectClassNameReg.test(bodyClassName))
18
- return;
19
- setStyle(cacheStyle);
20
- cacheStyle = {};
21
- document.body.className = bodyClassName.replace(scrollingEffectClassNameReg, "").trim();
22
- return;
23
- }
24
- const scrollBarSize = getScrollBarSize();
25
- if (scrollBarSize) {
26
- cacheStyle = setStyle({
27
- position: "relative",
28
- width: `calc(100% - ${scrollBarSize}px)`
29
- });
30
- if (!scrollingEffectClassNameReg.test(bodyClassName)) {
31
- const addClassName = `${bodyClassName} ${scrollingEffectClassName}`;
32
- document.body.className = addClassName.trim();
33
- }
34
- }
35
- };
36
- export {
37
- switchScrollingEffect as default
6
+ var cacheStyle = {};
7
+ var switchScrollingEffect_default = (close) => {
8
+ if (!isBodyOverflowing() && !close) return;
9
+ const scrollingEffectClassName = "ant-scrolling-effect";
10
+ const scrollingEffectClassNameReg = new RegExp(`${scrollingEffectClassName}`, "g");
11
+ const bodyClassName = document.body.className;
12
+ if (close) {
13
+ if (!scrollingEffectClassNameReg.test(bodyClassName)) return;
14
+ setStyle_default(cacheStyle);
15
+ cacheStyle = {};
16
+ document.body.className = bodyClassName.replace(scrollingEffectClassNameReg, "").trim();
17
+ return;
18
+ }
19
+ const scrollBarSize = getScrollBarSize();
20
+ if (scrollBarSize) {
21
+ cacheStyle = setStyle_default({
22
+ position: "relative",
23
+ width: `calc(100% - ${scrollBarSize}px)`
24
+ });
25
+ if (!scrollingEffectClassNameReg.test(bodyClassName)) {
26
+ const addClassName = `${bodyClassName} ${scrollingEffectClassName}`;
27
+ document.body.className = addClassName.trim();
28
+ }
29
+ }
38
30
  };
31
+ export { switchScrollingEffect_default as default };
@@ -1,52 +1,38 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
- const NO_EXIST = { __NOT_EXIST: true };
1
+ var NO_EXIST = { __NOT_EXIST: true };
4
2
  function spyElementPrototypes(elementClass, properties) {
5
- const propNames = Object.keys(properties);
6
- const originDescriptors = {};
7
- propNames.forEach((propName) => {
8
- const originDescriptor = Object.getOwnPropertyDescriptor(elementClass.prototype, propName);
9
- originDescriptors[propName] = originDescriptor || NO_EXIST;
10
- const spyProp = properties[propName];
11
- if (typeof spyProp === "function") {
12
- elementClass.prototype[propName] = function spyFunc(...args) {
13
- return spyProp.call(this, originDescriptor, ...args);
14
- };
15
- } else {
16
- Object.defineProperty(elementClass.prototype, propName, {
17
- ...spyProp,
18
- set(value) {
19
- if (spyProp.set)
20
- return spyProp.set.call(this, originDescriptor, value);
21
- return originDescriptor.set(value);
22
- },
23
- get() {
24
- if (spyProp.get)
25
- return spyProp.get.call(this, originDescriptor);
26
- return originDescriptor.get();
27
- },
28
- configurable: true
29
- });
30
- }
31
- });
32
- return {
33
- mockRestore() {
34
- propNames.forEach((propName) => {
35
- const originDescriptor = originDescriptors[propName];
36
- if (originDescriptor === NO_EXIST)
37
- delete elementClass.prototype[propName];
38
- else if (typeof originDescriptor === "function")
39
- elementClass.prototype[propName] = originDescriptor;
40
- else
41
- Object.defineProperty(elementClass.prototype, propName, originDescriptor);
42
- });
43
- }
44
- };
3
+ const propNames = Object.keys(properties);
4
+ const originDescriptors = {};
5
+ propNames.forEach((propName) => {
6
+ const originDescriptor = Object.getOwnPropertyDescriptor(elementClass.prototype, propName);
7
+ originDescriptors[propName] = originDescriptor || NO_EXIST;
8
+ const spyProp = properties[propName];
9
+ if (typeof spyProp === "function") elementClass.prototype[propName] = function spyFunc(...args) {
10
+ return spyProp.call(this, originDescriptor, ...args);
11
+ };
12
+ else Object.defineProperty(elementClass.prototype, propName, {
13
+ ...spyProp,
14
+ set(value) {
15
+ if (spyProp.set) return spyProp.set.call(this, originDescriptor, value);
16
+ return originDescriptor.set(value);
17
+ },
18
+ get() {
19
+ if (spyProp.get) return spyProp.get.call(this, originDescriptor);
20
+ return originDescriptor.get();
21
+ },
22
+ configurable: true
23
+ });
24
+ });
25
+ return { mockRestore() {
26
+ propNames.forEach((propName) => {
27
+ const originDescriptor = originDescriptors[propName];
28
+ if (originDescriptor === NO_EXIST) delete elementClass.prototype[propName];
29
+ else if (typeof originDescriptor === "function") elementClass.prototype[propName] = originDescriptor;
30
+ else Object.defineProperty(elementClass.prototype, propName, originDescriptor);
31
+ });
32
+ } };
45
33
  }
46
34
  function spyElementPrototype(Element, propName, property) {
47
- return spyElementPrototypes(Element, {
48
- [propName]: property
49
- });
35
+ return spyElementPrototypes(Element, { [propName]: property });
50
36
  }
51
37
  exports.spyElementPrototype = spyElementPrototype;
52
38
  exports.spyElementPrototypes = spyElementPrototypes;
@@ -1,52 +1,37 @@
1
- const NO_EXIST = { __NOT_EXIST: true };
1
+ var NO_EXIST = { __NOT_EXIST: true };
2
2
  function spyElementPrototypes(elementClass, properties) {
3
- const propNames = Object.keys(properties);
4
- const originDescriptors = {};
5
- propNames.forEach((propName) => {
6
- const originDescriptor = Object.getOwnPropertyDescriptor(elementClass.prototype, propName);
7
- originDescriptors[propName] = originDescriptor || NO_EXIST;
8
- const spyProp = properties[propName];
9
- if (typeof spyProp === "function") {
10
- elementClass.prototype[propName] = function spyFunc(...args) {
11
- return spyProp.call(this, originDescriptor, ...args);
12
- };
13
- } else {
14
- Object.defineProperty(elementClass.prototype, propName, {
15
- ...spyProp,
16
- set(value) {
17
- if (spyProp.set)
18
- return spyProp.set.call(this, originDescriptor, value);
19
- return originDescriptor.set(value);
20
- },
21
- get() {
22
- if (spyProp.get)
23
- return spyProp.get.call(this, originDescriptor);
24
- return originDescriptor.get();
25
- },
26
- configurable: true
27
- });
28
- }
29
- });
30
- return {
31
- mockRestore() {
32
- propNames.forEach((propName) => {
33
- const originDescriptor = originDescriptors[propName];
34
- if (originDescriptor === NO_EXIST)
35
- delete elementClass.prototype[propName];
36
- else if (typeof originDescriptor === "function")
37
- elementClass.prototype[propName] = originDescriptor;
38
- else
39
- Object.defineProperty(elementClass.prototype, propName, originDescriptor);
40
- });
41
- }
42
- };
3
+ const propNames = Object.keys(properties);
4
+ const originDescriptors = {};
5
+ propNames.forEach((propName) => {
6
+ const originDescriptor = Object.getOwnPropertyDescriptor(elementClass.prototype, propName);
7
+ originDescriptors[propName] = originDescriptor || NO_EXIST;
8
+ const spyProp = properties[propName];
9
+ if (typeof spyProp === "function") elementClass.prototype[propName] = function spyFunc(...args) {
10
+ return spyProp.call(this, originDescriptor, ...args);
11
+ };
12
+ else Object.defineProperty(elementClass.prototype, propName, {
13
+ ...spyProp,
14
+ set(value) {
15
+ if (spyProp.set) return spyProp.set.call(this, originDescriptor, value);
16
+ return originDescriptor.set(value);
17
+ },
18
+ get() {
19
+ if (spyProp.get) return spyProp.get.call(this, originDescriptor);
20
+ return originDescriptor.get();
21
+ },
22
+ configurable: true
23
+ });
24
+ });
25
+ return { mockRestore() {
26
+ propNames.forEach((propName) => {
27
+ const originDescriptor = originDescriptors[propName];
28
+ if (originDescriptor === NO_EXIST) delete elementClass.prototype[propName];
29
+ else if (typeof originDescriptor === "function") elementClass.prototype[propName] = originDescriptor;
30
+ else Object.defineProperty(elementClass.prototype, propName, originDescriptor);
31
+ });
32
+ } };
43
33
  }
44
34
  function spyElementPrototype(Element, propName, property) {
45
- return spyElementPrototypes(Element, {
46
- [propName]: property
47
- });
35
+ return spyElementPrototypes(Element, { [propName]: property });
48
36
  }
49
- export {
50
- spyElementPrototype,
51
- spyElementPrototypes
52
- };
37
+ export { spyElementPrototype, spyElementPrototypes };
package/dist/type.cjs CHANGED
@@ -1,41 +1,60 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
1
  const tuple = (...args) => args;
4
2
  const tupleNum = (...args) => args;
5
3
  function withInstall(comp) {
6
- const c = comp;
7
- c.install = function(app) {
8
- app.component(c.displayName || c.name, comp);
9
- };
10
- return comp;
4
+ const c = comp;
5
+ c.install = function(app) {
6
+ app.component(c.displayName || c.name, comp);
7
+ };
8
+ return comp;
11
9
  }
12
10
  function eventType() {
13
- return { type: [Function, Array] };
11
+ return { type: [Function, Array] };
14
12
  }
15
13
  function objectType(defaultVal) {
16
- return { type: Object, default: defaultVal };
14
+ return {
15
+ type: Object,
16
+ default: defaultVal
17
+ };
17
18
  }
18
19
  function booleanType(defaultVal) {
19
- return { type: Boolean, default: defaultVal };
20
+ return {
21
+ type: Boolean,
22
+ default: defaultVal
23
+ };
20
24
  }
21
25
  function functionType(defaultVal) {
22
- return { type: Function, default: defaultVal };
26
+ return {
27
+ type: Function,
28
+ default: defaultVal
29
+ };
23
30
  }
24
31
  function anyType(defaultVal, required) {
25
- const type = { validator: () => true, default: defaultVal };
26
- return required ? type : type;
32
+ const type = {
33
+ validator: () => true,
34
+ default: defaultVal
35
+ };
36
+ return required ? type : type;
27
37
  }
28
38
  function vNodeType() {
29
- return { validator: () => true };
39
+ return { validator: () => true };
30
40
  }
31
41
  function arrayType(defaultVal) {
32
- return { type: Array, default: defaultVal };
42
+ return {
43
+ type: Array,
44
+ default: defaultVal
45
+ };
33
46
  }
34
47
  function stringType(defaultVal) {
35
- return { type: String, default: defaultVal };
48
+ return {
49
+ type: String,
50
+ default: defaultVal
51
+ };
36
52
  }
37
53
  function someType(types, defaultVal) {
38
- return types ? { type: types, default: defaultVal } : anyType(defaultVal);
54
+ return types ? {
55
+ type: types,
56
+ default: defaultVal
57
+ } : anyType(defaultVal);
39
58
  }
40
59
  exports.anyType = anyType;
41
60
  exports.arrayType = arrayType;
package/dist/type.d.ts CHANGED
@@ -19,7 +19,7 @@ export interface PropOptions<T = any, D = T> {
19
19
  default?: D | DefaultFactory<D> | null | undefined | object;
20
20
  validator?: (value: unknown) => boolean;
21
21
  }
22
- declare type VNodeChildAtom = Component | VNode | string | number | null | undefined | void;
22
+ declare type VNodeChildAtom = Component | VNode | string | number | null | undefined | void | boolean;
23
23
  export type VueNode = VNodeChildAtom | VNodeChildAtom[] | VNode;
24
24
  export declare function withInstall<T>(comp: T): T & Plugin;
25
25
  export type MaybeRef<T> = T | Ref<T>;
package/dist/type.js CHANGED
@@ -1,51 +1,59 @@
1
1
  const tuple = (...args) => args;
2
2
  const tupleNum = (...args) => args;
3
3
  function withInstall(comp) {
4
- const c = comp;
5
- c.install = function(app) {
6
- app.component(c.displayName || c.name, comp);
7
- };
8
- return comp;
4
+ const c = comp;
5
+ c.install = function(app) {
6
+ app.component(c.displayName || c.name, comp);
7
+ };
8
+ return comp;
9
9
  }
10
10
  function eventType() {
11
- return { type: [Function, Array] };
11
+ return { type: [Function, Array] };
12
12
  }
13
13
  function objectType(defaultVal) {
14
- return { type: Object, default: defaultVal };
14
+ return {
15
+ type: Object,
16
+ default: defaultVal
17
+ };
15
18
  }
16
19
  function booleanType(defaultVal) {
17
- return { type: Boolean, default: defaultVal };
20
+ return {
21
+ type: Boolean,
22
+ default: defaultVal
23
+ };
18
24
  }
19
25
  function functionType(defaultVal) {
20
- return { type: Function, default: defaultVal };
26
+ return {
27
+ type: Function,
28
+ default: defaultVal
29
+ };
21
30
  }
22
31
  function anyType(defaultVal, required) {
23
- const type = { validator: () => true, default: defaultVal };
24
- return required ? type : type;
32
+ const type = {
33
+ validator: () => true,
34
+ default: defaultVal
35
+ };
36
+ return required ? type : type;
25
37
  }
26
38
  function vNodeType() {
27
- return { validator: () => true };
39
+ return { validator: () => true };
28
40
  }
29
41
  function arrayType(defaultVal) {
30
- return { type: Array, default: defaultVal };
42
+ return {
43
+ type: Array,
44
+ default: defaultVal
45
+ };
31
46
  }
32
47
  function stringType(defaultVal) {
33
- return { type: String, default: defaultVal };
48
+ return {
49
+ type: String,
50
+ default: defaultVal
51
+ };
34
52
  }
35
53
  function someType(types, defaultVal) {
36
- return types ? { type: types, default: defaultVal } : anyType(defaultVal);
37
- }
38
- export {
39
- anyType,
40
- arrayType,
41
- booleanType,
42
- eventType,
43
- functionType,
44
- objectType,
45
- someType,
46
- stringType,
47
- tuple,
48
- tupleNum,
49
- vNodeType,
50
- withInstall
51
- };
54
+ return types ? {
55
+ type: types,
56
+ default: defaultVal
57
+ } : anyType(defaultVal);
58
+ }
59
+ export { anyType, arrayType, booleanType, eventType, functionType, objectType, someType, stringType, tuple, tupleNum, vNodeType, withInstall };
@@ -1,13 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
1
  function checkSlotProp(props, slots, name, ...args) {
4
- if (slots[name])
5
- return slots[name]?.(...args);
6
- if (name in props) {
7
- if (typeof props[name] === "function")
8
- return props[name]?.(...args);
9
- return props[name];
10
- }
11
- return null;
2
+ if (slots[name]) return slots[name]?.(...args);
3
+ if (name in props) {
4
+ if (typeof props[name] === "function") return props[name]?.(...args);
5
+ return props[name];
6
+ }
7
+ return null;
12
8
  }
13
9
  exports.checkSlotProp = checkSlotProp;
@@ -1,13 +1,9 @@
1
1
  function checkSlotProp(props, slots, name, ...args) {
2
- if (slots[name])
3
- return slots[name]?.(...args);
4
- if (name in props) {
5
- if (typeof props[name] === "function")
6
- return props[name]?.(...args);
7
- return props[name];
8
- }
9
- return null;
2
+ if (slots[name]) return slots[name]?.(...args);
3
+ if (name in props) {
4
+ if (typeof props[name] === "function") return props[name]?.(...args);
5
+ return props[name];
6
+ }
7
+ return null;
10
8
  }
11
- export {
12
- checkSlotProp
13
- };
9
+ export { checkSlotProp };
@@ -1,12 +1,10 @@
1
- "use strict";
2
- Object.defineProperties(exports, { __esModule: { value: true }, [Symbol.toStringTag]: { value: "Module" } });
1
+ Object.defineProperty(exports, "__esModule", { value: true });
3
2
  function get(entity, path) {
4
- let current = entity;
5
- for (let i = 0; i < path.length; i += 1) {
6
- if (current === null || current === void 0)
7
- return void 0;
8
- current = current[path[i]];
9
- }
10
- return current;
3
+ let current = entity;
4
+ for (let i = 0; i < path.length; i += 1) {
5
+ if (current === null || current === void 0) return void 0;
6
+ current = current[path[i]];
7
+ }
8
+ return current;
11
9
  }
12
10
  exports.default = get;
package/dist/utils/get.js CHANGED
@@ -1,12 +1,9 @@
1
1
  function get(entity, path) {
2
- let current = entity;
3
- for (let i = 0; i < path.length; i += 1) {
4
- if (current === null || current === void 0)
5
- return void 0;
6
- current = current[path[i]];
7
- }
8
- return current;
2
+ let current = entity;
3
+ for (let i = 0; i < path.length; i += 1) {
4
+ if (current === null || current === void 0) return void 0;
5
+ current = current[path[i]];
6
+ }
7
+ return current;
9
8
  }
10
- export {
11
- get as default
12
- };
9
+ export { get as default };
@@ -1,10 +1,8 @@
1
- "use strict";
2
- Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
3
1
  function omit(obj, keys) {
4
- const result = { ...obj };
5
- keys.forEach((key) => {
6
- delete result[key];
7
- });
8
- return result;
2
+ const result = { ...obj };
3
+ keys.forEach((key) => {
4
+ delete result[key];
5
+ });
6
+ return result;
9
7
  }
10
8
  exports.omit = omit;
@@ -1,10 +1,8 @@
1
1
  function omit(obj, keys) {
2
- const result = { ...obj };
3
- keys.forEach((key) => {
4
- delete result[key];
5
- });
6
- return result;
2
+ const result = { ...obj };
3
+ keys.forEach((key) => {
4
+ delete result[key];
5
+ });
6
+ return result;
7
7
  }
8
- export {
9
- omit
10
- };
8
+ export { omit };