@i.un/libs
Advanced tools
Comparing version 0.0.5 to 0.0.6
@@ -28,3 +28,3 @@ /** | ||
*/ | ||
styles?: Record<string, string>; | ||
styles?: Record<string, string | number>; | ||
}; | ||
@@ -31,0 +31,0 @@ /** |
@@ -1,2 +0,2 @@ | ||
function t(t){return"function"==typeof(null==t?void 0:t.clone)}function e(t){const e=typeof t;return null===t||"string"===e||"number"===e||"boolean"===e||"undefined"===e}function n(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:this}function o(t){return e(t)?String(t):JSON.stringify(t,function(t,e){return"object"!=typeof e||null===e||Array.isArray(e)?e:Object.keys(e).sort().reduce((t,n)=>(t[n]=e[n],t),{})})}function r(e){if(null===e||"object"!=typeof e)return e;if(t(e))return e.clone();if(Array.isArray(e))return e.map(t=>r(t));const n={};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=r(e[t]));return n}const i={};function c(t){return i[t]}const s={timeout:6e4,timeoutResult:{code:408,msg:"请求超时"},identifier:""};function u(t,e=s){return function(...n){const u=o(n)+t.name+(e.identifier||"");if(i[u])return Promise.resolve(r(c(u)));const f=u+"_iun_load_ing";if(i[f]){const t=Object.assign({},s,e);return new Promise(e=>{const n=Date.now(),o=setInterval(()=>{i[u]?(clearInterval(o),e(r(c(u)))):Date.now()-n>t.timeout&&(i[f]=!1,clearInterval(o),e(r(t.timeoutResult)))},100)})}return i[f]=!0,t(...n).then(t=>(i[u]=t,r(i[u]))).catch(t=>{throw t}).finally(()=>{i[f]=!1})}}function f(t,e,n,o=!1){e in t.style?t.style[e]=n:t.style.setProperty(e,n,o?"important":"")}function l({tag:t="div",children:e=[],props:n={},attrs:o={},styles:r={}}={}){const i=document.createElement(t);Object.assign(i,n);for(const[t,e]of Object.entries(o))!1!==e&&i.setAttribute(t,e);for(const[t,e]of Object.entries(r))f(i,t,e);const c=Array.isArray(e)?e:[e];for(const t of c)t&&("object"==typeof t?t instanceof HTMLElement||t instanceof Text?i.appendChild(t):i.appendChild(l(t)):i.appendChild(document.createTextNode(t)));return i}export{r as cloneDeep,l as createElement,o as generateStableUniqueKey,n as getGlobal,t as isCloneable,e as isPrimitive,u as wrapFunctionWithCache}; | ||
function t(t){return"function"==typeof(null==t?void 0:t.clone)}function e(t){const e=typeof t;return null===t||"string"===e||"number"===e||"boolean"===e||"undefined"===e}function n(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:this}function o(t){return e(t)?String(t):JSON.stringify(t,function(t,e){return"object"!=typeof e||null===e||Array.isArray(e)?e:Object.keys(e).sort().reduce((t,n)=>(t[n]=e[n],t),{})})}function r(e){if(null===e||"object"!=typeof e)return e;if(t(e))return e.clone();if(Array.isArray(e))return e.map(t=>r(t));const n={};for(const t in e)Object.prototype.hasOwnProperty.call(e,t)&&(n[t]=r(e[t]));return n}const i={};function s(t){return i[t]}const c={timeout:6e4,timeoutResult:{code:408,msg:"请求超时"},identifier:""};function u(t,e=c){return function(...n){const u=o(n)+t.name+(e.identifier||"");if(i[u])return Promise.resolve(r(s(u)));const f=u+"_iun_load_ing";if(i[f]){const t=Object.assign({},c,e);return new Promise(e=>{const n=Date.now(),o=setInterval(()=>{i[u]?(clearInterval(o),e(r(s(u)))):Date.now()-n>t.timeout&&(i[f]=!1,clearInterval(o),e(r(t.timeoutResult)))},100)})}return i[f]=!0,t(...n).then(t=>(i[u]=t,r(i[u]))).catch(t=>{throw t}).finally(()=>{i[f]=!1})}}function f(t,e,n,o=!1){if(e in t.style)t.style[e]=n;else{const r=o?"important":"";t.style.setProperty(e,String(n),r)}}function l({tag:t="div",children:e=[],props:n={},attrs:o={},styles:r={}}={}){const i=document.createElement(t);Object.assign(i,n);for(const[t,e]of Object.entries(o))!1!==e&&i.setAttribute(t,e);for(const[t,e]of Object.entries(r))f(i,t,e);const s=Array.isArray(e)?e:[e];for(const t of s)t&&("object"==typeof t?t instanceof HTMLElement||t instanceof Text?i.appendChild(t):i.appendChild(l(t)):i.appendChild(document.createTextNode(t)));return i}export{r as cloneDeep,l as createElement,o as generateStableUniqueKey,n as getGlobal,t as isCloneable,e as isPrimitive,u as wrapFunctionWithCache}; | ||
//# sourceMappingURL=index.modern.js.map |
@@ -1,2 +0,2 @@ | ||
function e(e){return"function"==typeof(null==e?void 0:e.clone)}function t(e){var t=typeof e;return null===e||"string"===t||"number"===t||"boolean"===t||"undefined"===t}function n(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:this}function r(e){return t(e)?String(e):JSON.stringify(e,function(e,t){return"object"!=typeof t||null===t||Array.isArray(t)?t:Object.keys(t).sort().reduce(function(e,n){return e[n]=t[n],e},{})})}function o(t){if(null===t||"object"!=typeof t)return t;if(e(t))return t.clone();if(Array.isArray(t))return t.map(function(e){return o(e)});var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=o(t[r]));return n}var i={};function a(e){return i[e]}var u={timeout:6e4,timeoutResult:{code:408,msg:"请求超时"},identifier:""};function l(e,t){return void 0===t&&(t=u),function(){var n=[].slice.call(arguments),l=r(n)+e.name+(t.identifier||"");if(i[l])return Promise.resolve(o(a(l)));var f=l+"_iun_load_ing";if(i[f]){var c=Object.assign({},u,t);return new Promise(function(e){var t=Date.now(),n=setInterval(function(){i[l]?(clearInterval(n),e(o(a(l)))):Date.now()-t>c.timeout&&(i[f]=!1,clearInterval(n),e(o(c.timeoutResult)))},100)})}return i[f]=!0,e.apply(void 0,n).then(function(e){return i[l]=e,o(i[l])}).catch(function(e){throw e}).finally(function(){i[f]=!1})}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n,r){void 0===r&&(r=!1),t in e.style?e.style[t]=n:e.style.setProperty(t,n,r?"important":"")}function d(e){var t=void 0===e?{}:e,n=t.tag,r=t.children,o=void 0===r?[]:r,i=t.props,a=void 0===i?{}:i,u=t.attrs,l=void 0===u?{}:u,s=t.styles,v=void 0===s?{}:s,y=document.createElement(void 0===n?"div":n);Object.assign(y,a);for(var p=0,b=Object.entries(l);p<b.length;p++){var m=b[p],g=m[1];!1!==g&&y.setAttribute(m[0],g)}for(var h=0,A=Object.entries(v);h<A.length;h++){var j=A[h];c(y,j[0],j[1])}for(var w,O=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,t){if(e){if("string"==typeof e)return f(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}(e))){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(Array.isArray(o)?o:[o]);!(w=O()).done;){var S=w.value;S&&("object"==typeof S?S instanceof HTMLElement||S instanceof Text?y.appendChild(S):y.appendChild(d(S)):y.appendChild(document.createTextNode(S)))}return y}export{o as cloneDeep,d as createElement,r as generateStableUniqueKey,n as getGlobal,e as isCloneable,t as isPrimitive,l as wrapFunctionWithCache}; | ||
function e(e){return"function"==typeof(null==e?void 0:e.clone)}function t(e){var t=typeof e;return null===e||"string"===t||"number"===t||"boolean"===t||"undefined"===t}function n(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:this}function r(e){return t(e)?String(e):JSON.stringify(e,function(e,t){return"object"!=typeof t||null===t||Array.isArray(t)?t:Object.keys(t).sort().reduce(function(e,n){return e[n]=t[n],e},{})})}function o(t){if(null===t||"object"!=typeof t)return t;if(e(t))return t.clone();if(Array.isArray(t))return t.map(function(e){return o(e)});var n={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&(n[r]=o(t[r]));return n}var i={};function a(e){return i[e]}var u={timeout:6e4,timeoutResult:{code:408,msg:"请求超时"},identifier:""};function l(e,t){return void 0===t&&(t=u),function(){var n=[].slice.call(arguments),l=r(n)+e.name+(t.identifier||"");if(i[l])return Promise.resolve(o(a(l)));var f=l+"_iun_load_ing";if(i[f]){var c=Object.assign({},u,t);return new Promise(function(e){var t=Date.now(),n=setInterval(function(){i[l]?(clearInterval(n),e(o(a(l)))):Date.now()-t>c.timeout&&(i[f]=!1,clearInterval(n),e(o(c.timeoutResult)))},100)})}return i[f]=!0,e.apply(void 0,n).then(function(e){return i[l]=e,o(i[l])}).catch(function(e){throw e}).finally(function(){i[f]=!1})}}function f(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function c(e,t,n,r){if(void 0===r&&(r=!1),t in e.style)e.style[t]=n;else{var o=r?"important":"";e.style.setProperty(t,String(n),o)}}function d(e){var t=void 0===e?{}:e,n=t.tag,r=t.children,o=void 0===r?[]:r,i=t.props,a=void 0===i?{}:i,u=t.attrs,l=void 0===u?{}:u,s=t.styles,v=void 0===s?{}:s,y=document.createElement(void 0===n?"div":n);Object.assign(y,a);for(var p=0,b=Object.entries(l);p<b.length;p++){var m=b[p],g=m[1];!1!==g&&y.setAttribute(m[0],g)}for(var h=0,A=Object.entries(v);h<A.length;h++){var j=A[h];c(y,j[0],j[1])}for(var w,O=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,t){if(e){if("string"==typeof e)return f(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?f(e,t):void 0}}(e))){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(Array.isArray(o)?o:[o]);!(w=O()).done;){var S=w.value;S&&("object"==typeof S?S instanceof HTMLElement||S instanceof Text?y.appendChild(S):y.appendChild(d(S)):y.appendChild(document.createTextNode(S)))}return y}export{o as cloneDeep,d as createElement,r as generateStableUniqueKey,n as getGlobal,e as isCloneable,t as isPrimitive,l as wrapFunctionWithCache}; | ||
//# sourceMappingURL=index.module.js.map |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e||self).iunLibs={})}(this,function(e){function t(e){return"function"==typeof(null==e?void 0:e.clone)}function n(e){var t=typeof e;return null===e||"string"===t||"number"===t||"boolean"===t||"undefined"===t}function r(e){return n(e)?String(e):JSON.stringify(e,function(e,t){return"object"!=typeof t||null===t||Array.isArray(t)?t:Object.keys(t).sort().reduce(function(e,n){return e[n]=t[n],e},{})})}function o(e){if(null===e||"object"!=typeof e)return e;if(t(e))return e.clone();if(Array.isArray(e))return e.map(function(e){return o(e)});var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=o(e[r]));return n}var i={};function a(e){return i[e]}var u={timeout:6e4,timeoutResult:{code:408,msg:"请求超时"},identifier:""};function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t,n,r){void 0===r&&(r=!1),t in e.style?e.style[t]=n:e.style.setProperty(t,n,r?"important":"")}e.cloneDeep=o,e.createElement=function e(t){var n=void 0===t?{}:t,r=n.tag,o=n.children,i=void 0===o?[]:o,a=n.props,u=void 0===a?{}:a,c=n.attrs,d=void 0===c?{}:c,s=n.styles,y=void 0===s?{}:s,v=document.createElement(void 0===r?"div":r);Object.assign(v,u);for(var p=0,b=Object.entries(d);p<b.length;p++){var m=b[p],g=m[1];!1!==g&&v.setAttribute(m[0],g)}for(var h=0,A=Object.entries(y);h<A.length;h++){var j=A[h];f(v,j[0],j[1])}for(var w,O=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e))){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(Array.isArray(i)?i:[i]);!(w=O()).done;){var S=w.value;S&&("object"==typeof S?S instanceof HTMLElement||S instanceof Text?v.appendChild(S):v.appendChild(e(S)):v.appendChild(document.createTextNode(S)))}return v},e.generateStableUniqueKey=r,e.getGlobal=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:this},e.isCloneable=t,e.isPrimitive=n,e.wrapFunctionWithCache=function(e,t){return void 0===t&&(t=u),function(){var n=[].slice.call(arguments),l=r(n)+e.name+(t.identifier||"");if(i[l])return Promise.resolve(o(a(l)));var f=l+"_iun_load_ing";if(i[f]){var c=Object.assign({},u,t);return new Promise(function(e){var t=Date.now(),n=setInterval(function(){i[l]?(clearInterval(n),e(o(a(l)))):Date.now()-t>c.timeout&&(i[f]=!1,clearInterval(n),e(o(c.timeoutResult)))},100)})}return i[f]=!0,e.apply(void 0,n).then(function(e){return i[l]=e,o(i[l])}).catch(function(e){throw e}).finally(function(){i[f]=!1})}}}); | ||
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e||self).iunLibs={})}(this,function(e){function t(e){return"function"==typeof(null==e?void 0:e.clone)}function n(e){var t=typeof e;return null===e||"string"===t||"number"===t||"boolean"===t||"undefined"===t}function r(e){return n(e)?String(e):JSON.stringify(e,function(e,t){return"object"!=typeof t||null===t||Array.isArray(t)?t:Object.keys(t).sort().reduce(function(e,n){return e[n]=t[n],e},{})})}function i(e){if(null===e||"object"!=typeof e)return e;if(t(e))return e.clone();if(Array.isArray(e))return e.map(function(e){return i(e)});var n={};for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(n[r]=i(e[r]));return n}var o={};function a(e){return o[e]}var u={timeout:6e4,timeoutResult:{code:408,msg:"请求超时"},identifier:""};function l(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function f(e,t,n,r){if(void 0===r&&(r=!1),t in e.style)e.style[t]=n;else{var i=r?"important":"";e.style.setProperty(t,String(n),i)}}e.cloneDeep=i,e.createElement=function e(t){var n=void 0===t?{}:t,r=n.tag,i=n.children,o=void 0===i?[]:i,a=n.props,u=void 0===a?{}:a,c=n.attrs,s=void 0===c?{}:c,d=n.styles,y=void 0===d?{}:d,v=document.createElement(void 0===r?"div":r);Object.assign(v,u);for(var p=0,b=Object.entries(s);p<b.length;p++){var m=b[p],g=m[1];!1!==g&&v.setAttribute(m[0],g)}for(var h=0,A=Object.entries(y);h<A.length;h++){var j=A[h];f(v,j[0],j[1])}for(var w,O=function(e){var t="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(t)return(t=t.call(e)).next.bind(t);if(Array.isArray(e)||(t=function(e,t){if(e){if("string"==typeof e)return l(e,t);var n={}.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?l(e,t):void 0}}(e))){t&&(e=t);var n=0;return function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}(Array.isArray(o)?o:[o]);!(w=O()).done;){var S=w.value;S&&("object"==typeof S?S instanceof HTMLElement||S instanceof Text?v.appendChild(S):v.appendChild(e(S)):v.appendChild(document.createTextNode(S)))}return v},e.generateStableUniqueKey=r,e.getGlobal=function(){return"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:"undefined"!=typeof window?window:"undefined"!=typeof global?global:this},e.isCloneable=t,e.isPrimitive=n,e.wrapFunctionWithCache=function(e,t){return void 0===t&&(t=u),function(){var n=[].slice.call(arguments),l=r(n)+e.name+(t.identifier||"");if(o[l])return Promise.resolve(i(a(l)));var f=l+"_iun_load_ing";if(o[f]){var c=Object.assign({},u,t);return new Promise(function(e){var t=Date.now(),n=setInterval(function(){o[l]?(clearInterval(n),e(i(a(l)))):Date.now()-t>c.timeout&&(o[f]=!1,clearInterval(n),e(i(c.timeoutResult)))},100)})}return o[f]=!0,e.apply(void 0,n).then(function(e){return o[l]=e,i(o[l])}).catch(function(e){throw e}).finally(function(){o[f]=!1})}}}); | ||
//# sourceMappingURL=index.umd.js.map |
{ | ||
"name": "@i.un/libs", | ||
"version": "0.0.5", | ||
"version": "0.0.6", | ||
"description": "一个实用的ts函数库", | ||
@@ -5,0 +5,0 @@ "type": "module", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
74376