UNPKG

17 kBJavaScriptView Raw
1!function(t,n){"object"==typeof exports&&"object"==typeof module?module.exports=n():"function"==typeof define&&define.amd?define([],n):"object"==typeof exports?exports.diana=n():t.diana=n()}(window,function(){return function(t){var n={};function e(r){if(n[r])return n[r].exports;var o=n[r]={i:r,l:!1,exports:{}};return t[r].call(o.exports,o,o.exports,e),o.l=!0,o.exports}return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:r})},e.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},e.t=function(t,n){if(1&n&&(t=e(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(e.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)e.d(r,o,function(n){return t[n]}.bind(null,o));return r},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},e.p="",e(e.s=3)}([function(t,n,e){"use strict";var r={};e(2)(["Arguments","Function","String","Date","RegExp","Error","Symbol","Map","WeakMap","Set","WeakSet"],function(t){r["is"+t]=function(n){return Object.prototype.toString.call(n)==="[object "+t+"]"}}),r.isNumber=function(t){return"[object Number]"===Object.prototype.toString.call(t)&&!isNaN(t)},r.isArray=function(t){return Array.isArray(t)},t.exports=r},function(t,n,e){"use strict";t.exports=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];for(var e=[],r=0;r<t.length;r++)e=e.concat(t[r]);var o={},u=[];return e.forEach(function(t){o[typeof t+t]||(o[typeof t+t]=t,u.push(t))}),u}},function(t,n,e){"use strict";var r=Math.pow(2,53)-1,o=function(t){var n=null===t?void 0:t.length;return"number"==typeof n&&n>=0&&n<=r};t.exports=function(t,n,e){var r,u;if(n=function(t,n,e){if(void 0===n)return t;switch(e){case 1:return function(e){return t.call(n,e)}}return function(){for(var e=[],r=0;r<arguments.length;r++)e[r]=arguments[r];return t.apply(n,e)}}(n,e),o(t))for(r=0,u=t.length;r<u;r++)n(t[r],r,t);else{var i=Object.keys(t);for(r=0,u=i.length;r<u;r++)n(t[i[r]],i[r],t)}return this}},function(t,n,e){"use strict";var r=e(4),o=Object.assign({},r);t.exports=o},function(t,n,e){"use strict";var r=e(5),o=e(1),u=e(6),i=e(7),c=e(8),a=e(9),f=e(10),s=e(11),l=e(12),p=e(13),d=e(14),y=e(15),h=e(16),v=e(17),b=e(18),m=e(0),g=e(19),x=e(20),w=e(21),_=e(23),j=e(24),O=e(25),S=e(26),T=e(2),P=e(27),M=e(28),C=e(29),k=e(30),I={uniq:o,intersection:u,countInArr:i,difference:c,rdColor:a,rdNum:f,isEmail:s,isPhoneNum:l,trim:p,changeCase:d,escapeStr:y,sortStr:h,clone:v,cloneDeep:b,meanToCode:g.meanToCode,codeToMean:g.codeToMean,sum:x.sum,mean:x.mean,max:x.max,min:x.min,distance:x.distance,gcd:x.gcd,equal:w,pairs2obj:_,convertInObj:j,obj2query:O,query2obj:S,each:T,debounce:P.debounce,Debounce:P.Debounce,throttle:M,curry:C,timeTaken:k},D=r.__assign({},I,m);t.exports=D},function(t,n,e){"use strict";e.r(n),e.d(n,"__extends",function(){return o}),e.d(n,"__assign",function(){return u}),e.d(n,"__rest",function(){return i}),e.d(n,"__decorate",function(){return c}),e.d(n,"__param",function(){return a}),e.d(n,"__metadata",function(){return f}),e.d(n,"__awaiter",function(){return s}),e.d(n,"__generator",function(){return l}),e.d(n,"__exportStar",function(){return p}),e.d(n,"__values",function(){return d}),e.d(n,"__read",function(){return y}),e.d(n,"__spread",function(){return h}),e.d(n,"__await",function(){return v}),e.d(n,"__asyncGenerator",function(){return b}),e.d(n,"__asyncDelegator",function(){return m}),e.d(n,"__asyncValues",function(){return g}),e.d(n,"__makeTemplateObject",function(){return x}),e.d(n,"__importStar",function(){return w}),e.d(n,"__importDefault",function(){return _});
2/*! *****************************************************************************
3Copyright (c) Microsoft Corporation. All rights reserved.
4Licensed under the Apache License, Version 2.0 (the "License"); you may not use
5this file except in compliance with the License. You may obtain a copy of the
6License at http://www.apache.org/licenses/LICENSE-2.0
7
8THIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
9KIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED
10WARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,
11MERCHANTABLITY OR NON-INFRINGEMENT.
12
13See the Apache Version 2.0 License for specific language governing permissions
14and limitations under the License.
15***************************************************************************** */
16var r=function(t,n){return(r=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,n){t.__proto__=n}||function(t,n){for(var e in n)n.hasOwnProperty(e)&&(t[e]=n[e])})(t,n)};function o(t,n){function e(){this.constructor=t}r(t,n),t.prototype=null===n?Object.create(n):(e.prototype=n.prototype,new e)}var u=function(){return(u=Object.assign||function(t){for(var n,e=1,r=arguments.length;e<r;e++)for(var o in n=arguments[e])Object.prototype.hasOwnProperty.call(n,o)&&(t[o]=n[o]);return t}).apply(this,arguments)};function i(t,n){var e={};for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&n.indexOf(r)<0&&(e[r]=t[r]);if(null!=t&&"function"==typeof Object.getOwnPropertySymbols){var o=0;for(r=Object.getOwnPropertySymbols(t);o<r.length;o++)n.indexOf(r[o])<0&&(e[r[o]]=t[r[o]])}return e}function c(t,n,e,r){var o,u=arguments.length,i=u<3?n:null===r?r=Object.getOwnPropertyDescriptor(n,e):r;if("object"==typeof Reflect&&"function"==typeof Reflect.decorate)i=Reflect.decorate(t,n,e,r);else for(var c=t.length-1;c>=0;c--)(o=t[c])&&(i=(u<3?o(i):u>3?o(n,e,i):o(n,e))||i);return u>3&&i&&Object.defineProperty(n,e,i),i}function a(t,n){return function(e,r){n(e,r,t)}}function f(t,n){if("object"==typeof Reflect&&"function"==typeof Reflect.metadata)return Reflect.metadata(t,n)}function s(t,n,e,r){return new(e||(e=Promise))(function(o,u){function i(t){try{a(r.next(t))}catch(t){u(t)}}function c(t){try{a(r.throw(t))}catch(t){u(t)}}function a(t){t.done?o(t.value):new e(function(n){n(t.value)}).then(i,c)}a((r=r.apply(t,n||[])).next())})}function l(t,n){var e,r,o,u,i={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return u={next:c(0),throw:c(1),return:c(2)},"function"==typeof Symbol&&(u[Symbol.iterator]=function(){return this}),u;function c(u){return function(c){return function(u){if(e)throw new TypeError("Generator is already executing.");for(;i;)try{if(e=1,r&&(o=2&u[0]?r.return:u[0]?r.throw||((o=r.return)&&o.call(r),0):r.next)&&!(o=o.call(r,u[1])).done)return o;switch(r=0,o&&(u=[2&u[0],o.value]),u[0]){case 0:case 1:o=u;break;case 4:return i.label++,{value:u[1],done:!1};case 5:i.label++,r=u[1],u=[0];continue;case 7:u=i.ops.pop(),i.trys.pop();continue;default:if(!(o=(o=i.trys).length>0&&o[o.length-1])&&(6===u[0]||2===u[0])){i=0;continue}if(3===u[0]&&(!o||u[1]>o[0]&&u[1]<o[3])){i.label=u[1];break}if(6===u[0]&&i.label<o[1]){i.label=o[1],o=u;break}if(o&&i.label<o[2]){i.label=o[2],i.ops.push(u);break}o[2]&&i.ops.pop(),i.trys.pop();continue}u=n.call(t,i)}catch(t){u=[6,t],r=0}finally{e=o=0}if(5&u[0])throw u[1];return{value:u[0]?u[1]:void 0,done:!0}}([u,c])}}}function p(t,n){for(var e in t)n.hasOwnProperty(e)||(n[e]=t[e])}function d(t){var n="function"==typeof Symbol&&t[Symbol.iterator],e=0;return n?n.call(t):{next:function(){return t&&e>=t.length&&(t=void 0),{value:t&&t[e++],done:!t}}}}function y(t,n){var e="function"==typeof Symbol&&t[Symbol.iterator];if(!e)return t;var r,o,u=e.call(t),i=[];try{for(;(void 0===n||n-- >0)&&!(r=u.next()).done;)i.push(r.value)}catch(t){o={error:t}}finally{try{r&&!r.done&&(e=u.return)&&e.call(u)}finally{if(o)throw o.error}}return i}function h(){for(var t=[],n=0;n<arguments.length;n++)t=t.concat(y(arguments[n]));return t}function v(t){return this instanceof v?(this.v=t,this):new v(t)}function b(t,n,e){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var r,o=e.apply(t,n||[]),u=[];return r={},i("next"),i("throw"),i("return"),r[Symbol.asyncIterator]=function(){return this},r;function i(t){o[t]&&(r[t]=function(n){return new Promise(function(e,r){u.push([t,n,e,r])>1||c(t,n)})})}function c(t,n){try{!function(t){t.value instanceof v?Promise.resolve(t.value.v).then(a,f):s(u[0][2],t)}(o[t](n))}catch(t){s(u[0][3],t)}}function a(t){c("next",t)}function f(t){c("throw",t)}function s(t,n){t(n),u.shift(),u.length&&c(u[0][0],u[0][1])}}function m(t){var n,e;return n={},r("next"),r("throw",function(t){throw t}),r("return"),n[Symbol.iterator]=function(){return this},n;function r(r,o){n[r]=t[r]?function(n){return(e=!e)?{value:v(t[r](n)),done:"return"===r}:o?o(n):n}:o}}function g(t){if(!Symbol.asyncIterator)throw new TypeError("Symbol.asyncIterator is not defined.");var n,e=t[Symbol.asyncIterator];return e?e.call(t):(t=d(t),n={},r("next"),r("throw"),r("return"),n[Symbol.asyncIterator]=function(){return this},n);function r(e){n[e]=t[e]&&function(n){return new Promise(function(r,o){(function(t,n,e,r){Promise.resolve(r).then(function(n){t({value:n,done:e})},n)})(r,o,(n=t[e](n)).done,n.value)})}}}function x(t,n){return Object.defineProperty?Object.defineProperty(t,"raw",{value:n}):t.raw=n,t}function w(t){if(t&&t.__esModule)return t;var n={};if(null!=t)for(var e in t)Object.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n.default=t,n}function _(t){return t&&t.__esModule?t:{default:t}}},function(t,n,e){"use strict";var r=e(1);t.exports=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];if(1===t.length){for(var e=t[0].sort(),o=[],u=0;u<e.length-1;u++)e[u]===e[u+1]&&o.push(e[u]);return o}if(t.length>1){var i=[];for(u=0;u<t.length;u++)i=i.concat(r(t[u]));for(e=i.sort(),o=[],u=0;u<e.length-1;u++)e[u]===e[u+(t.length-1)]&&o.push(e[u]);return o}}},function(t,n,e){"use strict";t.exports=function(t,n){return t.reduce(function(t,e){return e===n?t+1:t+0},0)}},function(t,n,e){"use strict";t.exports=function(t,n){var e=new Set(n);return t.filter(function(t){return!e.has(t)})}},function(t,n,e){"use strict";t.exports=function(){return"#"+("000"+(16777216*Math.random()<<0).toString(16)).slice(-6)}},function(t,n,e){"use strict";t.exports=function(t,n,e){if(t===n)return"rdNum() 边界值不合理";var r=n-t,o=Math.random();switch(e){case"left":return t+Math.floor(o*r);case"right":return 0===o&&(o=1),t+Math.ceil(o*r);case"no":return n-t<1||n-t==1?"rdNum() 边界值不合理":(0===o&&(o=1),t+Math.ceil(o*(r-1)));default:return t+Math.round(o*r)}}},function(t,n,e){"use strict";t.exports=function(t){return/^[a-z0-9]+([._\\-]*[a-z0-9])*@(\w+([-.]\w+)*\.){1,63}[a-z0-9]+$/.test(t)}},function(t,n,e){"use strict";t.exports=function(t){return/^(0|86|17951)?(13[0-9]|15[012356789]|16[0-9]|17[0-9]|18[0-9]|14[0-9]|19[0-9])[0-9]{8}$/.test(String(t))}},function(t,n,e){"use strict";t.exports=function(t,n){switch(n){case 1:return t.replace(/\s*/g,"");case 2:return t.replace(/(^\s*)|(\s*$)/g,"");case 3:return t.replace(/(^\s*)/g,"");case 4:return t.replace(/(\s*$)/g,"");default:return t.replace(/\s*/g,"")}}},function(t,n,e){"use strict";t.exports=function(t,n){switch(n){case 1:return t.replace(/^(\w)(\w+)/,function(t,n,e){return n.toUpperCase()+e.toLowerCase()});case 2:return t.replace(/^(\w)(\w+)/,function(t,n,e){return n.toLowerCase()+e.toUpperCase()});case 3:return function(t){var n="";return t.split("").forEach(function(t){/^[a-z]/.test(t)?n+=t.toUpperCase():/^[A-Z]/.test(t)?n+=t.toLowerCase():n+=t}),n}(t);default:return t.replace(/^(\w)(\w+)/,function(t,n,e){return n.toUpperCase()+e.toLowerCase()})}}},function(t,n,e){"use strict";t.exports=function(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}},function(t,n,e){"use strict";t.exports=function(t){return t.split("").sort(function(t,n){return t.localeCompare(n)}).join("")}},function(t,n,e){"use strict";t.exports=function(t){if(t instanceof Object){var n={};for(var e in t)n[e]=t[e];return n}}},function(t,n,e){"use strict";var r=e(0),o=r.isDate,u=r.isRegExp,i=r.isFunction,c=r.isArray;var a=function(t){var n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),n};t.exports=function(t){var n=[],e=[];return function t(r){var f,s=n.indexOf(r);if(~s)return e[s];if(null==r||"object"!=typeof r&&!i(r))return r;if(o(r))return(f=new Date).setTime(r.getTime()),f;if(u(r))return f=new RegExp(r.source,a(r)),r.lastIndex&&(f.lastIndex=r.lastIndex),f;if(i(r))return new Function("return "+r)();if(c(r)){f=[],n.push(r),e.push(f);for(var l=0,p=r.length;l<p;l++)f[l]=t(r[l]);return f}if(r instanceof Object){var d=Object.getPrototypeOf(r);for(var y in f=Object.create(d),n.push(r),e.push(f),r)f[y]=t(r[y]);return f}}(t)}},function(t,n,e){"use strict";var r=e(0).isArray;var o={meanToCode:function(t,n){return r(t)&&t.find(function(t){return t.mean.toString()===n.toString()})?t.find(function(t){return t.mean.toString()===n.toString()}).code:null},codeToMean:function(t,n){return r(t)&&t.find(function(t){return t.code.toString()===n.toString()})?t.find(function(t){return t.code.toString()===n.toString()}).mean:null}};t.exports=o},function(t,n,e){"use strict";function r(t){return t.reduce(function(t,n){return t+n})}var o={distance:function(t,n,e,r){return Math.hypot(e-t,r-n)},gcd:function t(n,e){return e?t(e,n%e):n},max:function(t){return Math.max.apply(null,t)},mean:function(t){return r(t)/t.length},min:function(t){return Math.min.apply(null,t)},sum:r};t.exports=o},function(t,n,e){"use strict";var r=e(22);t.exports=function(t,n){return r(t,n)}},function(t,n,e){"use strict";var r=e(0).isFunction,o=Object.prototype.toString;function u(t,n,e,i){return t===n?0!==t||1/t==1/n:null!=t&&null!=n&&(t!=t?n!=n:("function"==typeof t||"object"==typeof t||"object"==typeof n)&&function(t,n,e,i){void 0===e&&(e=[]);void 0===i&&(i=[]);var c=o.call(t);if(c!==o.call(n))return!1;switch(c){case"[object RegExp]":case"[object String]":return""+t==""+n;case"[object Number]":return+t!=+t?+n!=+n:0==+t?1/+t==1/n:+t==+n;case"[object Date]":case"[object Boolean]":return+t==+n;case"[object Symbol]":return Symbol.prototype.valueOf.call(t)===Symbol.prototype.valueOf.call(n)}var a="[object Array]"===c;if(!a){if("object"!=typeof t||"object"!=typeof n)return!1;var f=t.constructor,s=n.constructor;if(f!==s&&!(r(f)&&f instanceof f&&r(s)&&s instanceof s))return!1}var l=e.length;for(;l--;)if(e[l]===t)return i[l]===n;if(e.push(t),i.push(n),a){var p=t.length;if(p!==n.length)return!1;for(;p--;)if(!u(t[p],n[p],e,i))return!1}else{var d=Object.keys(t),y=void 0,h=d.length;if(Object.keys(n).length!==h)return!1;for(;h--;)if(y=d[h],!n.hasOwnProperty(y)||!u(t[y],n[y],e,i))return!1}return e.pop(),i.pop(),!0}(t,n,e,i))}t.exports=u},function(t,n,e){"use strict";t.exports=function(t){return t.reduce(function(t,n){return t[n[0]]=n[1],t},{})}},function(t,n,e){"use strict";t.exports=function(t,n){return Object.keys(t).map(function(e){n.number&&n.number.length>0&&~n.number.indexOf(e)&&(""===t[e]||void 0===t[e]?t[e]=null:t[e]=Number(t[e])),n.string&&n.string.length>0&&~n.string.indexOf(e)&&(void 0===t[e]?t[e]=null:t[e]=String(t[e])),n.boolean&&n.boolean.length>0&&~n.boolean.indexOf(e)&&(void 0===t[e]?t[e]=null:t[e]=Boolean(Number(t[e])))}),t}},function(t,n,e){"use strict";t.exports=function(t,n){return n?t+"?"+Object.keys(n).filter(function(t){return null!=n[t]}).map(function(t){return t+"="+encodeURIComponent(n[t])}).join("&"):"请检查参数是否为对象"}},function(t,n,e){"use strict";t.exports=function(t){var n=t.substring(t.lastIndexOf("?")+1);if(!n)return{};for(var e={},r=0,o=decodeURIComponent(n).split("&").filter(function(t){return""!==t});r<o.length;r++){var u=o[r],i=u.match(/.*?(?==)/);i&&(e[i[0]]=u.substring(u.indexOf("=")+1))}return e}},function(t,n,e){"use strict";function r(t,n,e){var r,o,u=function(){for(var u=this,i=[],c=0;c<arguments.length;c++)i[c]=arguments[c];if(r&&clearTimeout(r),e){var a=!r;r=setTimeout(function(){r=null},n),a&&(o=t.apply(this,i))}else r=setTimeout(function(){t.apply(u,i)},n);return o};return u.cancel=function(){clearTimeout(r),r=null},u}var o={debounce:r,Debounce:function(t,n){return function(e,o,u){u.value=r(e[o],t,n)}}};t.exports=o},function(t,n,e){"use strict";t.exports=function(t,n,e){var r,o=0;e||(e={});var u=function(){for(var u=this,i=[],c=0;c<arguments.length;c++)i[c]=arguments[c];var a=(new Date).getTime();o||!1!==e.leading||(o=a);var f=n-(a-o);f<=0||a<o?(r&&(clearTimeout(r),r=null),o=a,t.apply(this,i)):r||!1===e.trailing||(r=setTimeout(function(){o=!1===e.leading?0:(new Date).getTime(),r=null,t.apply(u,i)},f))};return u.cancel=function(){for(var t=[],n=0;n<arguments.length;n++)t[n]=arguments[n];clearTimeout(r),o=0,r=null},u}},function(t,n,e){"use strict";t.exports=function t(n,e){void 0===e&&(e=n.length);for(var r=[],o=2;o<arguments.length;o++)r[o-2]=arguments[o];return e<=r.length?n.apply(void 0,r):t.bind.apply(t,[null,n,e].concat(r))}},function(t,n,e){"use strict";t.exports=function(t){console.time("timeTaken");var n=t();return console.timeEnd("timeTaken"),n}}])});
\No newline at end of file