@gx-design-vue/pro-utils 0.0.14 → 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.
package/dist/index.d.ts CHANGED
@@ -3,6 +3,7 @@ import { isScroll, getScrollContainer, isInContainer } from './scroll';
3
3
  import scrollTo from './scroll/scrollTo';
4
4
  import getScroll from './scroll/getScroll';
5
5
  import throttleByAnimationFrame from './scroll/throttleByAnimationFrame';
6
+ export * from './omitUndefined';
6
7
  export * from './slots';
7
8
  export * from './utils';
8
9
  export * from './utils/validate';
package/dist/index.es.js CHANGED
@@ -200,6 +200,19 @@ function throttleByAnimationFrame(fn) {
200
200
  return throttled;
201
201
  }
202
202
 
203
+ const omitUndefined = (obj) => {
204
+ const newObj = {};
205
+ Object.keys(obj || {}).forEach((key) => {
206
+ if (obj[key] !== undefined) {
207
+ newObj[key] = obj[key];
208
+ }
209
+ });
210
+ if (Object.keys(newObj).length < 1) {
211
+ return undefined;
212
+ }
213
+ return newObj;
214
+ };
215
+
203
216
  function getSlot(slots, props, prop = 'default') {
204
217
  if (props[prop] === false) {
205
218
  return false;
@@ -943,4 +956,4 @@ function off(element, event, handler, useCapture = false) {
943
956
  }
944
957
  }
945
958
 
946
- export { arrayRepeat, blobToDataURL, checkFileType, compareArray, dataURLtoBlob, dataURLtoFile, deepCopy, formatDuraton, genColumnKey, generateVidoePicture, getBase64, getBlobUrl, getFileSuffix, getLevelData, getMaxFloor, getMediaInfos, getPrefixCls, getRandomNumber, getScroll, getScrollContainer, getSlot, getSlotVNode, getSlotsProps, getSortIndex, getVideoCoverPicture, getVideoFileUrl, handleCurrentPage, handleShowIndex, hanndleField, is, isArray, isBase64, isBoolean, isFunction, isInContainer, isNumber, isObject, isScroll, isServer, isString, off, on, runFunction, scrollTo, throttleByAnimationFrame, treeData };
959
+ export { arrayRepeat, blobToDataURL, checkFileType, compareArray, dataURLtoBlob, dataURLtoFile, deepCopy, formatDuraton, genColumnKey, generateVidoePicture, getBase64, getBlobUrl, getFileSuffix, getLevelData, getMaxFloor, getMediaInfos, getPrefixCls, getRandomNumber, getScroll, getScrollContainer, getSlot, getSlotVNode, getSlotsProps, getSortIndex, getVideoCoverPicture, getVideoFileUrl, handleCurrentPage, handleShowIndex, hanndleField, is, isArray, isBase64, isBoolean, isFunction, isInContainer, isNumber, isObject, isScroll, isServer, isString, off, omitUndefined, on, runFunction, scrollTo, throttleByAnimationFrame, treeData };
package/dist/index.js CHANGED
@@ -204,6 +204,19 @@ function throttleByAnimationFrame(fn) {
204
204
  return throttled;
205
205
  }
206
206
 
207
+ const omitUndefined = (obj) => {
208
+ const newObj = {};
209
+ Object.keys(obj || {}).forEach((key) => {
210
+ if (obj[key] !== undefined) {
211
+ newObj[key] = obj[key];
212
+ }
213
+ });
214
+ if (Object.keys(newObj).length < 1) {
215
+ return undefined;
216
+ }
217
+ return newObj;
218
+ };
219
+
207
220
  function getSlot(slots, props, prop = 'default') {
208
221
  if (props[prop] === false) {
209
222
  return false;
@@ -988,6 +1001,7 @@ exports.isScroll = isScroll;
988
1001
  exports.isServer = isServer;
989
1002
  exports.isString = isString;
990
1003
  exports.off = off;
1004
+ exports.omitUndefined = omitUndefined;
991
1005
  exports.on = on;
992
1006
  exports.runFunction = runFunction;
993
1007
  exports.scrollTo = scrollTo;
@@ -0,0 +1,5 @@
1
+ declare type OmitUndefined<T> = {
2
+ [P in keyof T]: NonNullable<T[P]>;
3
+ };
4
+ export declare const omitUndefined: <T>(obj: T) => OmitUndefined<T>;
5
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gx-design-vue/pro-utils",
3
- "version": "0.0.14",
3
+ "version": "0.0.15",
4
4
  "description": "@gx-design-vue/pro-utils",
5
5
  "license": "MIT",
6
6
  "types": "dist/index.d.ts",