UNPKG

1.27 kBJavaScriptView Raw
1!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).e={})}(this,(function(e){"use strict";const t=["string","bigint","number","boolean"];e.debounce=(e,t)=>{let n=null;return(...o)=>{null!==n&&(clearTimeout(n),n=null),n=setTimeout(()=>e(...o),t)}},e.deepClone=function e(n){if(null===n||(o=n,t.includes(typeof o)))return n;var o;if(Array.isArray(n)){const t=[];for(const o of n)t.push(e(o));return t}if(function(e){return!("object"!=typeof e||!e)&&e.constructor===Object}(n)){const t={};for(const[o,r]of Object.entries(n))t[o]=e(r);return t}if(n instanceof Map){const t=new n.constructor;for(const[o,r]of n.entries())t.set(o,e(r));return t}if(n instanceof Set){const t=new n.constructor;for(const o of n.values())t.add(e(o));return t}return n},e.noOp=function(){},e.notEmpty=function(e){return null!=e},e.objectEntries=function(e){return Object.entries(e)},e.objectKeys=function(e){return Object.keys(e)},e.objectValues=function(e){return Object.values(e)},e.primitiveTypes=t,e.sleep=function(e){return new Promise(t=>setTimeout(t,e))},Object.defineProperty(e,"__esModule",{value:!0})}));
2//# sourceMappingURL=index.umd.js.map