wjk-util 0.0.5 → 0.0.7
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/vite.svg +1 -1
- package/dist/wjk-util.es.js +1 -0
- package/dist/wjk-util.umd.js +1 -0
- package/package.json +43 -42
- package/types/index.d.ts +2 -0
- package/types/module/file.d.ts +4 -0
- package/types/module/finance.d.ts +9 -0
- package/dist/f-util.es.js +0 -1
- package/dist/f-util.umd.js +0 -1
package/dist/vite.svg
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg xmlns="http://www.w3.org/2000/svg" width="77" height="47" fill="none" aria-labelledby="vite-logo-title" viewBox="0 0 77 47"><title id="vite-logo-title">Vite</title><style>.parenthesis{fill:#000}@media (prefers-color-scheme:dark){.parenthesis{fill:#fff}}</style><path fill="#9135ff" d="M40.151 45.71c-.663.844-2.02.374-2.02-.699V34.708a2.26 2.26 0 0 0-2.262-2.262H24.493c-.92 0-1.457-1.04-.92-1.788l7.479-10.471c1.07-1.498 0-3.578-1.842-3.578H15.443c-.92 0-1.456-1.04-.92-1.788l9.696-13.576c.213-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.472c-1.07 1.497 0 3.578 1.842 3.578h11.376c.944 0 1.474 1.087.89 1.83L40.153 45.712z"/><mask id="a" width="48" height="47" x="14" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#000" d="M40.047 45.71c-.663.843-2.02.374-2.02-.699V34.708a2.26 2.26 0 0 0-2.262-2.262H24.389c-.92 0-1.457-1.04-.92-1.788l7.479-10.472c1.07-1.497 0-3.578-1.842-3.578H15.34c-.92 0-1.456-1.04-.92-1.788l9.696-13.575c.213-.297.556-.474.92-.474H53.93c.92 0 1.456 1.04.92 1.788L47.37 13.03c-1.07 1.498 0 3.578 1.842 3.578h11.376c.944 0 1.474 1.088.89 1.831L40.049 45.712z"/></mask><g mask="url(#a)"><g filter="url(#b)"><ellipse cx="5.508" cy="14.704" fill="#eee6ff" rx="5.508" ry="14.704" transform="rotate(269.814 20.96 11.29)scale(-1 1)"/></g><g filter="url(#c)"><ellipse cx="10.399" cy="29.851" fill="#eee6ff" rx="10.399" ry="29.851" transform="rotate(89.814 -16.902 -8.275)scale(1 -1)"/></g><g filter="url(#d)"><ellipse cx="5.508" cy="30.487" fill="#8900ff" rx="5.508" ry="30.487" transform="rotate(89.814 -19.197 -7.127)scale(1 -1)"/></g><g filter="url(#e)"><ellipse cx="5.508" cy="30.599" fill="#8900ff" rx="5.508" ry="30.599" transform="rotate(89.814 -25.928 4.177)scale(1 -1)"/></g><g filter="url(#f)"><ellipse cx="5.508" cy="30.599" fill="#8900ff" rx="5.508" ry="30.599" transform="rotate(89.814 -25.738 5.52)scale(1 -1)"/></g><g filter="url(#g)"><ellipse cx="14.072" cy="22.078" fill="#eee6ff" rx="14.072" ry="22.078" transform="rotate(93.35 31.245 55.578)scale(-1 1)"/></g><g filter="url(#h)"><ellipse cx="3.47" cy="21.501" fill="#8900ff" rx="3.47" ry="21.501" transform="rotate(89.009 35.419 55.202)scale(-1 1)"/></g><g filter="url(#i)"><ellipse cx="3.47" cy="21.501" fill="#8900ff" rx="3.47" ry="21.501" transform="rotate(89.009 35.419 55.202)scale(-1 1)"/></g><g filter="url(#j)"><ellipse cx="14.592" cy="9.743" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(39.51 14.592 9.743)"/></g><g filter="url(#k)"><ellipse cx="61.728" cy="-5.321" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 61.728 -5.32)"/></g><g filter="url(#l)"><ellipse cx="55.618" cy="7.104" fill="#00c2ff" rx="5.971" ry="9.665" transform="rotate(37.892 55.618 7.104)"/></g><g filter="url(#m)"><ellipse cx="12.326" cy="39.103" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 12.326 39.103)"/></g><g filter="url(#n)"><ellipse cx="12.326" cy="39.103" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 12.326 39.103)"/></g><g filter="url(#o)"><ellipse cx="49.857" cy="30.678" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 49.857 30.678)"/></g><g filter="url(#p)"><ellipse cx="52.623" cy="33.171" fill="#00c2ff" rx="5.971" ry="15.297" transform="rotate(37.892 52.623 33.17)"/></g></g><path d="M6.919 0c-9.198 13.166-9.252 33.575 0 46.789h6.215c-9.25-13.214-9.196-33.623 0-46.789zm62.424 0h-6.215c9.198 13.166 9.252 33.575 0 46.789h6.215c9.25-13.214 9.196-33.623 0-46.789" class="parenthesis"/><defs><filter id="b" width="60.045" height="41.654" x="-5.564" y="16.92" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="7.659"/></filter><filter id="c" width="90.34" height="51.437" x="-40.407" y="-6.762" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="7.659"/></filter><filter id="d" width="79.355" height="29.4" x="-35.435" y="2.801" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="e" width="79.579" height="29.4" x="-30.84" y="20.8" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="f" width="79.579" height="29.4" x="-29.307" y="21.949" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="g" width="74.749" height="58.852" x="29.961" y="-17.13" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="7.659"/></filter><filter id="h" width="61.377" height="25.362" x="37.754" y="3.055" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="i" width="61.377" height="25.362" x="37.754" y="3.055" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="j" width="56.045" height="63.649" x="-13.43" y="-22.082" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="k" width="54.814" height="64.646" x="34.321" y="-37.644" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="l" width="33.541" height="35.313" x="38.847" y="-10.552" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="m" width="54.814" height="64.646" x="-15.081" y="6.78" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="n" width="54.814" height="64.646" x="-15.081" y="6.78" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="o" width="54.814" height="64.646" x="22.45" y="-1.645" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="p" width="39.409" height="43.623" x="32.919" y="11.36" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter></defs></svg>
|
|
1
|
+
<svg xmlns="http://www.w3.org/2000/svg" width="77" height="47" fill="none" aria-labelledby="vite-logo-title" viewBox="0 0 77 47"><title id="vite-logo-title">Vite</title><style>.parenthesis{fill:#000}@media (prefers-color-scheme:dark){.parenthesis{fill:#fff}}</style><path fill="#9135ff" d="M40.151 45.71c-.663.844-2.02.374-2.02-.699V34.708a2.26 2.26 0 0 0-2.262-2.262H24.493c-.92 0-1.457-1.04-.92-1.788l7.479-10.471c1.07-1.498 0-3.578-1.842-3.578H15.443c-.92 0-1.456-1.04-.92-1.788l9.696-13.576c.213-.297.556-.474.92-.474h28.894c.92 0 1.456 1.04.92 1.788l-7.48 10.472c-1.07 1.497 0 3.578 1.842 3.578h11.376c.944 0 1.474 1.087.89 1.83L40.153 45.712z"/><mask id="a" width="48" height="47" x="14" y="0" maskUnits="userSpaceOnUse" style="mask-type:alpha"><path fill="#000" d="M40.047 45.71c-.663.843-2.02.374-2.02-.699V34.708a2.26 2.26 0 0 0-2.262-2.262H24.389c-.92 0-1.457-1.04-.92-1.788l7.479-10.472c1.07-1.497 0-3.578-1.842-3.578H15.34c-.92 0-1.456-1.04-.92-1.788l9.696-13.575c.213-.297.556-.474.92-.474H53.93c.92 0 1.456 1.04.92 1.788L47.37 13.03c-1.07 1.498 0 3.578 1.842 3.578h11.376c.944 0 1.474 1.088.89 1.831L40.049 45.712z"/></mask><g mask="url(#a)"><g filter="url(#b)"><ellipse cx="5.508" cy="14.704" fill="#eee6ff" rx="5.508" ry="14.704" transform="rotate(269.814 20.96 11.29)scale(-1 1)"/></g><g filter="url(#c)"><ellipse cx="10.399" cy="29.851" fill="#eee6ff" rx="10.399" ry="29.851" transform="rotate(89.814 -16.902 -8.275)scale(1 -1)"/></g><g filter="url(#d)"><ellipse cx="5.508" cy="30.487" fill="#8900ff" rx="5.508" ry="30.487" transform="rotate(89.814 -19.197 -7.127)scale(1 -1)"/></g><g filter="url(#e)"><ellipse cx="5.508" cy="30.599" fill="#8900ff" rx="5.508" ry="30.599" transform="rotate(89.814 -25.928 4.177)scale(1 -1)"/></g><g filter="url(#f)"><ellipse cx="5.508" cy="30.599" fill="#8900ff" rx="5.508" ry="30.599" transform="rotate(89.814 -25.738 5.52)scale(1 -1)"/></g><g filter="url(#g)"><ellipse cx="14.072" cy="22.078" fill="#eee6ff" rx="14.072" ry="22.078" transform="rotate(93.35 31.245 55.578)scale(-1 1)"/></g><g filter="url(#h)"><ellipse cx="3.47" cy="21.501" fill="#8900ff" rx="3.47" ry="21.501" transform="rotate(89.009 35.419 55.202)scale(-1 1)"/></g><g filter="url(#i)"><ellipse cx="3.47" cy="21.501" fill="#8900ff" rx="3.47" ry="21.501" transform="rotate(89.009 35.419 55.202)scale(-1 1)"/></g><g filter="url(#j)"><ellipse cx="14.592" cy="9.743" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(39.51 14.592 9.743)"/></g><g filter="url(#k)"><ellipse cx="61.728" cy="-5.321" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 61.728 -5.32)"/></g><g filter="url(#l)"><ellipse cx="55.618" cy="7.104" fill="#00c2ff" rx="5.971" ry="9.665" transform="rotate(37.892 55.618 7.104)"/></g><g filter="url(#m)"><ellipse cx="12.326" cy="39.103" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 12.326 39.103)"/></g><g filter="url(#n)"><ellipse cx="12.326" cy="39.103" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 12.326 39.103)"/></g><g filter="url(#o)"><ellipse cx="49.857" cy="30.678" fill="#8900ff" rx="4.407" ry="29.108" transform="rotate(37.892 49.857 30.678)"/></g><g filter="url(#p)"><ellipse cx="52.623" cy="33.171" fill="#00c2ff" rx="5.971" ry="15.297" transform="rotate(37.892 52.623 33.17)"/></g></g><path d="M6.919 0c-9.198 13.166-9.252 33.575 0 46.789h6.215c-9.25-13.214-9.196-33.623 0-46.789zm62.424 0h-6.215c9.198 13.166 9.252 33.575 0 46.789h6.215c9.25-13.214 9.196-33.623 0-46.789" class="parenthesis"/><defs><filter id="b" width="60.045" height="41.654" x="-5.564" y="16.92" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="7.659"/></filter><filter id="c" width="90.34" height="51.437" x="-40.407" y="-6.762" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="7.659"/></filter><filter id="d" width="79.355" height="29.4" x="-35.435" y="2.801" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="e" width="79.579" height="29.4" x="-30.84" y="20.8" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="f" width="79.579" height="29.4" x="-29.307" y="21.949" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="g" width="74.749" height="58.852" x="29.961" y="-17.13" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="7.659"/></filter><filter id="h" width="61.377" height="25.362" x="37.754" y="3.055" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="i" width="61.377" height="25.362" x="37.754" y="3.055" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="j" width="56.045" height="63.649" x="-13.43" y="-22.082" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="k" width="54.814" height="64.646" x="34.321" y="-37.644" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="l" width="33.541" height="35.313" x="38.847" y="-10.552" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="m" width="54.814" height="64.646" x="-15.081" y="6.78" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="n" width="54.814" height="64.646" x="-15.081" y="6.78" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="o" width="54.814" height="64.646" x="22.45" y="-1.645" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter><filter id="p" width="39.409" height="43.623" x="32.919" y="11.36" color-interpolation-filters="sRGB" filterUnits="userSpaceOnUse"><feFlood flood-opacity="0" result="BackgroundImageFix"/><feBlend in="SourceGraphic" in2="BackgroundImageFix" result="shape"/><feGaussianBlur result="effect1_foregroundBlur_2002_17286" stdDeviation="4.596"/></filter></defs></svg>
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
function e(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function t(e){return Array.isArray(e)}function n(t){return"object"===e(t)}function r(e){return"function"==typeof e}function o(e){return"string"==typeof e}function c(e){return"number"==typeof e&&!isNaN(e)}function i(e){return"boolean"==typeof e}function u(e){return null===e}function a(e){return void 0===e}function s(e){return!(!u(e)&&!a(e))||(o(e)||t(e)?0===e.length:!!n(e)&&0===Object.keys(e).length)}function l(e){if(!Array.isArray(e))throw new Error("参数必须是数组");return[...new Set(e)]}function f(e,t=1){if(!Array.isArray(e))throw new Error("参数必须是数组");return t<=0?e.slice():e.reduce((e,n)=>e.concat(Array.isArray(n)?f(n,t-1):[n]),[])}function y(e,t=1){if(!Array.isArray(e))throw new Error("参数必须是数组");if(t<=0)return[];const n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n}function h(e){if(Array.isArray(e)&&0!==e.length)return Math.max(...e)}function p(e){if(Array.isArray(e)&&0!==e.length)return Math.min(...e)}function g(e){if(!Array.isArray(e))throw new Error("参数必须是数组");return e.reduce((e,t)=>e+t,0)}function d(e){if(Array.isArray(e)&&0!==e.length)return g(e)/e.length}function m(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array)return e.map(e=>m(e));if(e instanceof Object){const t={};for(let n in e)e.hasOwnProperty(n)&&(t[n]=m(e[n]));return t}return e}function v(...e){const t={};return e.forEach(e=>{e&&"object"==typeof e&&Object.keys(e).forEach(n=>{const r=n;void 0!==e[r]&&(t[r]=e[r])})}),t}function b(e){return"object"!=typeof e||null===e?[]:Object.keys(e)}function w(e){return"object"!=typeof e||null===e?[]:Object.values(e)}function A(e,t){return"object"==typeof e&&null!==e&&e.hasOwnProperty(t)}function E(e,t){return Math.floor(Math.random()*(t-e+1))+e}function j(e,t,n){return Math.min(Math.max(e,t),n)}function O(e){return e*(Math.PI/180)}function S(e){return e*(180/Math.PI)}function x(e,t){const n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)}function L(e,t){return Number(Math.round(parseFloat(e+"e"+t))+"e-"+t)}function M(e,t,n=!1){try{(n?sessionStorage:localStorage).setItem(e,JSON.stringify(t))}catch(r){console.error("存储失败:",r)}}function k(e,t=!1){try{const n=(t?sessionStorage:localStorage).getItem(e);return n?JSON.parse(n):null}catch(n){return console.error("获取存储失败:",n),null}}function P(e,t=!1){try{(t?sessionStorage:localStorage).removeItem(e)}catch(n){console.error("删除存储失败:",n)}}function I(e=!1){try{(e?sessionStorage:localStorage).clear()}catch(t){console.error("清空存储失败:",t)}}function N(){return new Promise(e=>{const t=document.createElement("input");t.type="file",t.accept=".xls,.xlsx,.xlsm",t.click(),t.addEventListener("change",function n(r){const o=r.target,c=o.files?.[0];if(c){const n=c.name.split("."),r=n[n.length-1];t.accept.includes(r)?e(c):(console.error("Excel文件上传格式错误"),e(void 0))}else e(void 0);t.removeEventListener("change",n)})})}function R(){return new Promise(e=>{const t=document.createElement("input");t.type="file",t.accept=".jpg,.png,.jpeg,.gif",t.click(),t.addEventListener("change",function n(r){const o=r.target,c=o.files?.[0];if(c){const n=c.name.split("."),r=n[n.length-1];t.accept.includes(r)?e(c):(console.error("图片上传格式错误"),e(void 0))}else e(void 0);t.removeEventListener("change",n)})})}function U(){return new Promise(e=>{const t=document.createElement("input");t.type="file",t.accept=".gltf,.glb",t.click(),t.addEventListener("change",function n(r){const o=r.target,c=o.files?.[0];if(c){const n=c.name.split("."),r=n[n.length-1];t.accept.includes(r)?e(c):(console.error("模型上传格式错误"),e(void 0))}else e(void 0);t.removeEventListener("change",n)})})}function C(e,t,n="application/vnd.ms-excel;charset=utf-8"){const r=document.createElement("a");r.download=t,r.style.display="none";const o=new Blob([e],{type:n});r.href=URL.createObjectURL(o),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(r.href)}function D(e,t,n){return e*Math.pow(1+t,n)}console.log(D(1e4,.025,208));export{d as average,y as chunk,j as clamp,I as clearStorage,D as compoundInterest,m as deepClone,O as degreesToRadians,x as distance,C as downloadFile,f as flatten,k as getStorage,e as getType,A as hasKey,t as isArray,i as isBoolean,s as isEmpty,r as isFunction,u as isNull,c as isNumber,n as isObject,o as isString,a as isUndefined,b as keys,h as max,v as merge,p as min,S as radiansToDegrees,E as randomInt,P as removeStorage,L as round,M as setStorage,g as sum,l as unique,N as uploadExcelFile,R as uploadImageFile,U as uploadModelFile,w as values};
|
|
@@ -0,0 +1 @@
|
|
|
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).WJKUtil={})}(this,function(e){"use strict";function t(e){return Object.prototype.toString.call(e).slice(8,-1).toLowerCase()}function n(e){return Array.isArray(e)}function r(e){return"object"===t(e)}function o(e){return"string"==typeof e}function c(e){return null===e}function i(e){return void 0===e}function a(e){if(!Array.isArray(e))throw new Error("参数必须是数组");return e.reduce((e,t)=>e+t,0)}function u(e,t,n){return e*Math.pow(1+t,n)}console.log(u(1e4,.025,208)),e.average=function(e){if(Array.isArray(e)&&0!==e.length)return a(e)/e.length},e.chunk=function(e,t=1){if(!Array.isArray(e))throw new Error("参数必须是数组");if(t<=0)return[];const n=[];for(let r=0;r<e.length;r+=t)n.push(e.slice(r,r+t));return n},e.clamp=function(e,t,n){return Math.min(Math.max(e,t),n)},e.clearStorage=function(e=!1){try{(e?sessionStorage:localStorage).clear()}catch(t){console.error("清空存储失败:",t)}},e.compoundInterest=u,e.deepClone=function e(t){if(null===t||"object"!=typeof t)return t;if(t instanceof Date)return new Date(t.getTime());if(t instanceof Array)return t.map(t=>e(t));if(t instanceof Object){const n={};for(let r in t)t.hasOwnProperty(r)&&(n[r]=e(t[r]));return n}return t},e.degreesToRadians=function(e){return e*(Math.PI/180)},e.distance=function(e,t){const n=t.x-e.x,r=t.y-e.y;return Math.sqrt(n*n+r*r)},e.downloadFile=function(e,t,n="application/vnd.ms-excel;charset=utf-8"){const r=document.createElement("a");r.download=t,r.style.display="none";const o=new Blob([e],{type:n});r.href=URL.createObjectURL(o),document.body.appendChild(r),r.click(),document.body.removeChild(r),URL.revokeObjectURL(r.href)},e.flatten=function e(t,n=1){if(!Array.isArray(t))throw new Error("参数必须是数组");return n<=0?t.slice():t.reduce((t,r)=>t.concat(Array.isArray(r)?e(r,n-1):[r]),[])},e.getStorage=function(e,t=!1){try{const n=(t?sessionStorage:localStorage).getItem(e);return n?JSON.parse(n):null}catch(n){return console.error("获取存储失败:",n),null}},e.getType=t,e.hasKey=function(e,t){return"object"==typeof e&&null!==e&&e.hasOwnProperty(t)},e.isArray=n,e.isBoolean=function(e){return"boolean"==typeof e},e.isEmpty=function(e){return!(!c(e)&&!i(e))||(o(e)||n(e)?0===e.length:!!r(e)&&0===Object.keys(e).length)},e.isFunction=function(e){return"function"==typeof e},e.isNull=c,e.isNumber=function(e){return"number"==typeof e&&!isNaN(e)},e.isObject=r,e.isString=o,e.isUndefined=i,e.keys=function(e){return"object"!=typeof e||null===e?[]:Object.keys(e)},e.max=function(e){if(Array.isArray(e)&&0!==e.length)return Math.max(...e)},e.merge=function(...e){const t={};return e.forEach(e=>{e&&"object"==typeof e&&Object.keys(e).forEach(n=>{const r=n;void 0!==e[r]&&(t[r]=e[r])})}),t},e.min=function(e){if(Array.isArray(e)&&0!==e.length)return Math.min(...e)},e.radiansToDegrees=function(e){return e*(180/Math.PI)},e.randomInt=function(e,t){return Math.floor(Math.random()*(t-e+1))+e},e.removeStorage=function(e,t=!1){try{(t?sessionStorage:localStorage).removeItem(e)}catch(n){console.error("删除存储失败:",n)}},e.round=function(e,t){return Number(Math.round(parseFloat(e+"e"+t))+"e-"+t)},e.setStorage=function(e,t,n=!1){try{(n?sessionStorage:localStorage).setItem(e,JSON.stringify(t))}catch(r){console.error("存储失败:",r)}},e.sum=a,e.unique=function(e){if(!Array.isArray(e))throw new Error("参数必须是数组");return[...new Set(e)]},e.uploadExcelFile=function(){return new Promise(e=>{const t=document.createElement("input");t.type="file",t.accept=".xls,.xlsx,.xlsm",t.click(),t.addEventListener("change",function n(r){const o=r.target,c=o.files?.[0];if(c){const n=c.name.split("."),r=n[n.length-1];t.accept.includes(r)?e(c):(console.error("Excel文件上传格式错误"),e(void 0))}else e(void 0);t.removeEventListener("change",n)})})},e.uploadImageFile=function(){return new Promise(e=>{const t=document.createElement("input");t.type="file",t.accept=".jpg,.png,.jpeg,.gif",t.click(),t.addEventListener("change",function n(r){const o=r.target,c=o.files?.[0];if(c){const n=c.name.split("."),r=n[n.length-1];t.accept.includes(r)?e(c):(console.error("图片上传格式错误"),e(void 0))}else e(void 0);t.removeEventListener("change",n)})})},e.uploadModelFile=function(){return new Promise(e=>{const t=document.createElement("input");t.type="file",t.accept=".gltf,.glb",t.click(),t.addEventListener("change",function n(r){const o=r.target,c=o.files?.[0];if(c){const n=c.name.split("."),r=n[n.length-1];t.accept.includes(r)?e(c):(console.error("模型上传格式错误"),e(void 0))}else e(void 0);t.removeEventListener("change",n)})})},e.values=function(e){return"object"!=typeof e||null===e?[]:Object.values(e)},Object.defineProperty(e,Symbol.toStringTag,{value:"Module"})});
|
package/package.json
CHANGED
|
@@ -1,42 +1,43 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "wjk-util",
|
|
3
|
-
"version": "0.0.
|
|
4
|
-
"type": "module",
|
|
5
|
-
"description": "一个包含常见 JavaScript 函数的实用库",
|
|
6
|
-
"author": "wjk",
|
|
7
|
-
"license": "MIT",
|
|
8
|
-
"repository": {
|
|
9
|
-
"type": "gitee",
|
|
10
|
-
"url": "https://gitee.com/wjkfree/
|
|
11
|
-
},
|
|
12
|
-
"homepage": "https://gitee.com/wjkfree/
|
|
13
|
-
"keywords": [
|
|
14
|
-
"utility",
|
|
15
|
-
"functions",
|
|
16
|
-
"typescript"
|
|
17
|
-
],
|
|
18
|
-
"files": [
|
|
19
|
-
"dist",
|
|
20
|
-
"types"
|
|
21
|
-
],
|
|
22
|
-
"main": "./dist/
|
|
23
|
-
"module": "./dist/
|
|
24
|
-
"types": "./types/index.d.ts",
|
|
25
|
-
"exports": {
|
|
26
|
-
"types": "./types/index.d.ts",
|
|
27
|
-
"import": "./dist/
|
|
28
|
-
"require": "./dist/
|
|
29
|
-
},
|
|
30
|
-
"sideEffects": false,
|
|
31
|
-
"scripts": {
|
|
32
|
-
"dev": "vite",
|
|
33
|
-
"build": "vite build",
|
|
34
|
-
"
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
"
|
|
39
|
-
"
|
|
40
|
-
"vite
|
|
41
|
-
|
|
42
|
-
}
|
|
1
|
+
{
|
|
2
|
+
"name": "wjk-util",
|
|
3
|
+
"version": "0.0.7",
|
|
4
|
+
"type": "module",
|
|
5
|
+
"description": "一个包含常见 JavaScript 函数的实用库",
|
|
6
|
+
"author": "wjk",
|
|
7
|
+
"license": "MIT",
|
|
8
|
+
"repository": {
|
|
9
|
+
"type": "gitee",
|
|
10
|
+
"url": "https://gitee.com/wjkfree/wjk-util.git"
|
|
11
|
+
},
|
|
12
|
+
"homepage": "https://gitee.com/wjkfree/wjk-util#readme",
|
|
13
|
+
"keywords": [
|
|
14
|
+
"utility",
|
|
15
|
+
"functions",
|
|
16
|
+
"typescript"
|
|
17
|
+
],
|
|
18
|
+
"files": [
|
|
19
|
+
"dist",
|
|
20
|
+
"types"
|
|
21
|
+
],
|
|
22
|
+
"main": "./dist/wjk-util.umd.js",
|
|
23
|
+
"module": "./dist/wjk-util.es.js",
|
|
24
|
+
"types": "./types/index.d.ts",
|
|
25
|
+
"exports": {
|
|
26
|
+
"types": "./types/index.d.ts",
|
|
27
|
+
"import": "./dist/wjk-util.es.js",
|
|
28
|
+
"require": "./dist/wjk-util.umd.js"
|
|
29
|
+
},
|
|
30
|
+
"sideEffects": false,
|
|
31
|
+
"scripts": {
|
|
32
|
+
"dev": "vite",
|
|
33
|
+
"build": "vite build",
|
|
34
|
+
"patch": "npm version patch",
|
|
35
|
+
"publish": "npm publish"
|
|
36
|
+
},
|
|
37
|
+
"devDependencies": {
|
|
38
|
+
"terser": "^5.46.0",
|
|
39
|
+
"typescript": "~5.9.3",
|
|
40
|
+
"vite": "^7.3.1",
|
|
41
|
+
"vite-plugin-dts": "^4.5.4"
|
|
42
|
+
}
|
|
43
|
+
}
|
package/types/index.d.ts
CHANGED
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
export declare function uploadExcelFile(): Promise<File | undefined>;
|
|
2
|
+
export declare function uploadImageFile(): Promise<File | undefined>;
|
|
3
|
+
export declare function uploadModelFile(): Promise<File | undefined>;
|
|
4
|
+
export declare function downloadFile(data: string | Blob | ArrayBuffer, name: string, mimeType?: string): void;
|
package/dist/f-util.es.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
function r(r){return Object.prototype.toString.call(r).slice(8,-1).toLowerCase()}function t(r){return Array.isArray(r)}function n(t){return"object"===r(t)}function e(r){return"function"==typeof r}function o(r){return"string"==typeof r}function u(r){return"number"==typeof r&&!isNaN(r)}function c(r){return"boolean"==typeof r}function i(r){return null===r}function a(r){return void 0===r}function f(r){return!(!i(r)&&!a(r))||(o(r)||t(r)?0===r.length:!!n(r)&&0===Object.keys(r).length)}function s(r){if(!Array.isArray(r))throw new Error("参数必须是数组");return[...new Set(r)]}function l(r,t=1){if(!Array.isArray(r))throw new Error("参数必须是数组");return t<=0?r.slice():r.reduce((r,n)=>r.concat(Array.isArray(n)?l(n,t-1):[n]),[])}function y(r,t=1){if(!Array.isArray(r))throw new Error("参数必须是数组");if(t<=0)return[];const n=[];for(let e=0;e<r.length;e+=t)n.push(r.slice(e,e+t));return n}function h(r){if(Array.isArray(r)&&0!==r.length)return Math.max(...r)}function g(r){if(Array.isArray(r)&&0!==r.length)return Math.min(...r)}function A(r){if(!Array.isArray(r))throw new Error("参数必须是数组");return r.reduce((r,t)=>r+t,0)}function p(r){if(Array.isArray(r)&&0!==r.length)return A(r)/r.length}function b(r){if(null===r||"object"!=typeof r)return r;if(r instanceof Date)return new Date(r.getTime());if(r instanceof Array)return r.map(r=>b(r));if(r instanceof Object){const t={};for(let n in r)r.hasOwnProperty(n)&&(t[n]=b(r[n]));return t}return r}function m(...r){const t={};return r.forEach(r=>{r&&"object"==typeof r&&Object.keys(r).forEach(n=>{const e=n;void 0!==r[e]&&(t[e]=r[e])})}),t}function w(r){return"object"!=typeof r||null===r?[]:Object.keys(r)}function j(r){return"object"!=typeof r||null===r?[]:Object.values(r)}function S(r,t){return"object"==typeof r&&null!==r&&r.hasOwnProperty(t)}function M(r,t){return Math.floor(Math.random()*(t-r+1))+r}function O(r,t,n){return Math.min(Math.max(r,t),n)}function d(r){return r*(Math.PI/180)}function E(r){return r*(180/Math.PI)}function x(r,t){const n=t.x-r.x,e=t.y-r.y;return Math.sqrt(n*n+e*e)}function I(r,t){return Number(Math.round(parseFloat(r+"e"+t))+"e-"+t)}function N(r,t,n=!1){try{(n?sessionStorage:localStorage).setItem(r,JSON.stringify(t))}catch(e){console.error("存储失败:",e)}}function v(r,t=!1){try{const n=(t?sessionStorage:localStorage).getItem(r);return n?JSON.parse(n):null}catch(n){return console.error("获取存储失败:",n),null}}function P(r,t=!1){try{(t?sessionStorage:localStorage).removeItem(r)}catch(n){console.error("删除存储失败:",n)}}function k(r=!1){try{(r?sessionStorage:localStorage).clear()}catch(t){console.error("清空存储失败:",t)}}export{p as average,y as chunk,O as clamp,k as clearStorage,b as deepClone,d as degreesToRadians,x as distance,l as flatten,v as getStorage,r as getType,S as hasKey,t as isArray,c as isBoolean,f as isEmpty,e as isFunction,i as isNull,u as isNumber,n as isObject,o as isString,a as isUndefined,w as keys,h as max,m as merge,g as min,E as radiansToDegrees,M as randomInt,P as removeStorage,I as round,N as setStorage,A as sum,s as unique,j as values};
|
package/dist/f-util.umd.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
!function(r,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((r="undefined"!=typeof globalThis?globalThis:r||self).FUtil={})}(this,function(r){"use strict";function e(r){return Object.prototype.toString.call(r).slice(8,-1).toLowerCase()}function t(r){return Array.isArray(r)}function n(r){return"object"===e(r)}function o(r){return"string"==typeof r}function i(r){return null===r}function u(r){return void 0===r}function a(r){if(!Array.isArray(r))throw new Error("参数必须是数组");return r.reduce((r,e)=>r+e,0)}r.average=function(r){if(Array.isArray(r)&&0!==r.length)return a(r)/r.length},r.chunk=function(r,e=1){if(!Array.isArray(r))throw new Error("参数必须是数组");if(e<=0)return[];const t=[];for(let n=0;n<r.length;n+=e)t.push(r.slice(n,n+e));return t},r.clamp=function(r,e,t){return Math.min(Math.max(r,e),t)},r.clearStorage=function(r=!1){try{(r?sessionStorage:localStorage).clear()}catch(e){console.error("清空存储失败:",e)}},r.deepClone=function r(e){if(null===e||"object"!=typeof e)return e;if(e instanceof Date)return new Date(e.getTime());if(e instanceof Array)return e.map(e=>r(e));if(e instanceof Object){const t={};for(let n in e)e.hasOwnProperty(n)&&(t[n]=r(e[n]));return t}return e},r.degreesToRadians=function(r){return r*(Math.PI/180)},r.distance=function(r,e){const t=e.x-r.x,n=e.y-r.y;return Math.sqrt(t*t+n*n)},r.flatten=function r(e,t=1){if(!Array.isArray(e))throw new Error("参数必须是数组");return t<=0?e.slice():e.reduce((e,n)=>e.concat(Array.isArray(n)?r(n,t-1):[n]),[])},r.getStorage=function(r,e=!1){try{const t=(e?sessionStorage:localStorage).getItem(r);return t?JSON.parse(t):null}catch(t){return console.error("获取存储失败:",t),null}},r.getType=e,r.hasKey=function(r,e){return"object"==typeof r&&null!==r&&r.hasOwnProperty(e)},r.isArray=t,r.isBoolean=function(r){return"boolean"==typeof r},r.isEmpty=function(r){return!(!i(r)&&!u(r))||(o(r)||t(r)?0===r.length:!!n(r)&&0===Object.keys(r).length)},r.isFunction=function(r){return"function"==typeof r},r.isNull=i,r.isNumber=function(r){return"number"==typeof r&&!isNaN(r)},r.isObject=n,r.isString=o,r.isUndefined=u,r.keys=function(r){return"object"!=typeof r||null===r?[]:Object.keys(r)},r.max=function(r){if(Array.isArray(r)&&0!==r.length)return Math.max(...r)},r.merge=function(...r){const e={};return r.forEach(r=>{r&&"object"==typeof r&&Object.keys(r).forEach(t=>{const n=t;void 0!==r[n]&&(e[n]=r[n])})}),e},r.min=function(r){if(Array.isArray(r)&&0!==r.length)return Math.min(...r)},r.radiansToDegrees=function(r){return r*(180/Math.PI)},r.randomInt=function(r,e){return Math.floor(Math.random()*(e-r+1))+r},r.removeStorage=function(r,e=!1){try{(e?sessionStorage:localStorage).removeItem(r)}catch(t){console.error("删除存储失败:",t)}},r.round=function(r,e){return Number(Math.round(parseFloat(r+"e"+e))+"e-"+e)},r.setStorage=function(r,e,t=!1){try{(t?sessionStorage:localStorage).setItem(r,JSON.stringify(e))}catch(n){console.error("存储失败:",n)}},r.sum=a,r.unique=function(r){if(!Array.isArray(r))throw new Error("参数必须是数组");return[...new Set(r)]},r.values=function(r){return"object"!=typeof r||null===r?[]:Object.values(r)},Object.defineProperty(r,Symbol.toStringTag,{value:"Module"})});
|