UNPKG

@10yun/cv-js-utils

Version:

常用 js-utils 工具类库

2 lines 20.5 kB
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.cvUtils=e():t.cvUtils=e()}(self,(function(){return function(){var __webpack_modules__={909:function(){},361:function(__unused_webpack_module,__webpack_exports__,__webpack_require__){"use strict";function isDecimal(val){var length=arguments.length>1&&void 0!==arguments[1]?arguments[1]:2,reg=eval("/^(([1-9]{1}\\d*)|(0{1}))(\\.\\d{1,"+length+"})?$/");return reg.test(val)}function isNumNumber(t){return t.toString().search(/^[+-]?[0-9.]*$/)>=0}function isNumInt(t){return Math.floor(t)===t}function isNumPosi(t){if(""==t)return!1;return/^[1-9]\d*$/.test(t)}function isNumZS(t){return!!/^\d+(?=\.{0,1}\d+$|$)/.test(t)}function isNumCode(val){var length=arguments.length>1&&void 0!==arguments[1]?arguments[1]:6,reg=eval("/[0-9]{"+length+"}$/");return reg.test(val)}var uCheckValid={isDecimal:isDecimal,isNumNumber:isNumNumber,isNumInt:isNumInt,isNumPosi:isNumPosi,isNumZS:isNumZS,isNumCode:isNumCode};__webpack_exports__.ZP=uCheckValid}},__webpack_module_cache__={};function __webpack_require__(t){var e=__webpack_module_cache__[t];if(void 0!==e)return e.exports;var r=__webpack_module_cache__[t]={exports:{}};return __webpack_modules__[t](r,r.exports,__webpack_require__),r.exports}__webpack_require__.d=function(t,e){for(var r in e)__webpack_require__.o(e,r)&&!__webpack_require__.o(t,r)&&Object.defineProperty(t,r,{enumerable:!0,get:e[r]})},__webpack_require__.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},__webpack_require__.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})};var __webpack_exports__={};return function(){"use strict";__webpack_require__.d(__webpack_exports__,{default:function(){return P}});var t={};__webpack_require__.r(t),__webpack_require__.d(t,{default:function(){return n}});var e=__webpack_require__(909);function r(t){return r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},r(t)}var n={arrayConcat:function(){for(var t=arguments.length||0,e={},r=0;r<t;r++)e=Object.assign(e,arguments[r]);return e},arrayConvert:function(t){var e={};for(var r in t)void 0===e[t[r].name]?e[t[r].name]=t[r].value:e[t[r].name]+=","+t[r].value;return e},arrayLetterSort:function(t,e,r){var n,o=t.sort((n=e,function(t,e){var r=t[n],o=e[n];return r<o?-1:r>o?1:0}));if(1==(r=r||!1)){for(var i=[],a=0;a<26;a++){var u=String.fromCharCode(65+a),c=(String.fromCharCode(97+a),[]);for(var s in o)u===o[s][e]&&void 0!==o[s]&&null!==o[s]&&c.push(o[s]);void 0!==c&&c.length>0&&i.push({letter:u,tree:c})}return i}return o},arrayColumnsNeed:function(t,e){var r=[];return t.forEach((function(t,n){r[n]={},e.map((function(e){r[n][e]="",void 0!==t[e]&&null!==t[e]&&(r[n][e]=t[e])}))})),r},arrayDisposeData:function(t,e){var r=[];return r=t,t.forEach((function(t,e){for(var n in t)for(var o in"true"!=t[n]&&1!=t[n]||(r[e][n]=!0),"false"!=t[n]&&0!=t[n]||(r[e][n]=!1),initArr)if(n==o&&"[]"===initArr[o])""!=t[n]&&null!=t[n]||(r[e][n]=[])})),r},arrayInArray:function(t,e){for(s=0;s<e.length;s++)if(thisEntry=e[s].toString(),thisEntry==t)return!0;return!1},arrayInValue:function(t,e){return t.includes(e)},arrayColumns:function(t,e){var r=[];return"string"==typeof e&&e.constructor==String&&(e=(e=e.replace(/\s*/g,"")).split(",")),t.forEach((function(t,n){r[n]={},e.map((function(e){r[n][e]="",void 0!==t[e]&&null!==t[e]&&(r[n][e]=t[e])}))})),r},arrayMerge:function(t,e){delete e.data},arrayMixin:function(t,e){var n,o=Array.prototype.slice.call(arguments),i=1,a="boolean"!=typeof o[o.length-1]||o.pop();for(1===o.length&&(t=this,i=0);e=o[i++];)for(n in e)n in t?"object"==r(e[n])&&"object"==r(t[n])?t[n]=Object.assign(t[n],e[n]):"function"==typeof e[n]&&"function"==typeof t[n]&&(t[n]=e[n]):!a&&n in t||(t[n]=e[n]);return t},arrayExtend:function(t){for(var e=Array.prototype.slice.call(arguments,1),r=0;r<e.length;r+=1){var n=e[r];for(var o in n)n.hasOwnProperty(o)&&(t[o]=n[o])}return t}};function o(t){return function(t){if(Array.isArray(t))return i(t)}(t)||function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)}(t)||function(t,e){if(!t)return;if("string"==typeof t)return i(t,e);var r=Object.prototype.toString.call(t).slice(8,-1);"Object"===r&&t.constructor&&(r=t.constructor.name);if("Map"===r||"Set"===r)return Array.from(t);if("Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r))return i(t,e)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function i(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=new Array(e);r<e;r++)n[r]=t[r];return n}var a={arrayToTree:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{id:"id",pid:"pid",children:"children"},n=[],i={},a=[0,"0",void 0,"undefined",null,"null","00000000-0000-0000-0000-000000000000",""];return e.forEach((function(t){var u,c=e.filter((function(e){return e[r.pid]===t[r.id]}));t[r.children]&&t[r.children]instanceof Array&&t[r.children].length>0?(t[r.children].map((function(t){return i[t[r.id]]=1})),(u=t[r.children]).push.apply(u,o(c.filter((function(t){return 1!==i[t[r.id]]}))))):t[r.children]=c;var s=c.length>0;(s||!s&&a.includes(t[r.pid]))&&n.push(t)})),n.every((function(t){return a.includes(t[r.pid])}))?n:t(n,r)},treeDeepInVal:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1?arguments[1]:void 0,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"Id",o=arguments.length>3&&void 0!==arguments[3]?arguments[3]:"Children";return e.reduce((function(e,i){return e.concat(i[n]==r?i:t(i[o]||[],r,n,o))}),[])},treeToFlatten:function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"Children";return e.reduce((function(e,n){return e.concat(n,n[r]?t(n[r],r):[])}),[])},treeCalcLevel:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],e=0;return function t(r,n){++n,e=Math.max(n,e);for(var o=0;o<r.length;o++){var i=r[o];i.level=n,i.children&&i.children.length>0?t(i.children,n):delete i.children}}(t,0),e}};function u(t){return u="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t},u(t)}function c(t){var e;if("[object Array]"==Object.prototype.toString.call(t)){e=[];for(var r=0;r<t.length;r++)e.push(c(t[r]));return e}if("[object Object]"==Object.prototype.toString.call(t)){for(var n in e={},t)e[n]=t[n];return e}}var l={objDeepClone:function(t,e){var r=e||{};for(var n in t){var o=t[n];o!==r&&("object"===u(o)?r[n]=o.constructor===Array?[]:Object.create(o):r[n]=o)}return r},objDeepCopy:c,objDeepCopy2:function(t){var e=t instanceof Array?[]:{};for(var r in t)e[r]="object"===u(t[r])?c(t[r]):t[r];return e}};function f(t){return t.replace(/\s+/g,"")}var p={isBank:function(t){return t=t?f(t):"",/^[0-9]{12,}$/.test(t)},isEmail:function(t){return/^\w+([-+.]\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*$/.test(t)},isEmoji:function(t){return/[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF][\u200D|\uFE0F]|[\uD83C|\uD83D|\uD83E][\uDC00-\uDFFF]|[0-9|*|#]\uFE0F\u20E3|[0-9|#]\u20E3|[\u203C-\u3299]\uFE0F\u200D|[\u203C-\u3299]\uFE0F|[\u2122-\u2B55]|\u303D|[\A9|\AE]\u3030|\uA9|\uAE|\u3030/gi.test(t)},isMobile:function(t){return""!=(t=t||"")&&(t=t?f(t):"",t=parseInt(t),!!/^((13[0-9])|(14[5,7,9])|(15[^4])|(16[6])|(17[1,2,3,5,6,7,8])|(18[0-9])|(19[1,8,9]))+\d{8}$/.test(t))},isPostal:function(t){return t=t?f(t):"",/^[0-9]{6}$/.test(t)},isPhone:function(t){return t=t?f(t):"",!!(/^0?1[3|4|5|8][0-9]\d{8}$/.test(t)||/^([0-9]{3,4}-)?[0-9]{7,8}$/.test(t)||/^400[0-9]{7}$/.test(t))},isUrlHttp:function(t){return t=t?f(t):"",!!"/^http|https://([w-]+(.[w-]+)+(/[w-./?%@&+=一-龥]*)?)?$/".test(t)},isUrl:function(t){return t=t?f(t):"",!!"/^(w+://)?w+(.w+)+.*$/".test(t)},isPassportID:function(t){return/^[a-zA-Z0-9]{8,20}$/.test(t)},isIdentity:function(t){return t=t?f(t):"",!!/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(t)},isRequire:function(t){return""!=(t=t?f(t):"").replace(/\s+/g,"")},isEmpty:function(t){return null==t||null==t||""==t},isEmptyTrim:function(t){return/^\s*$/g.test(t.replace(/^\s+|\s+$/g,""))},isEmptyObject:function(t){for(var e in t)return!1;return!0},isIdCard:function(t){if(!t)return!1;var e=(t=t.replace(/(^\s*)|(\s*$)/g,"")).match(/[^\x00-\xff]/g);if(18!=t.length+(e?e.length:0))return!1;var r=t.split("");return!(!function(t){var e=t.substring(6,10),r=t.substring(10,12),n=t.substring(12,14),o=new Date(e,parseFloat(r)-1,parseFloat(n));return o.getFullYear()==parseFloat(e)&&o.getMonth()==parseFloat(r)-1&&o.getDate()==parseFloat(n)}(t)||!function(t){var e=[7,9,10,5,8,4,2,1,6,3,7,9,10,5,8,4,2,1],r=0;"x"==t[17].toLowerCase()&&(t[17]=10);for(var n=0;n<17;n++)r+=e[n]*t[n];var o=r%11;return t[17]==[1,0,10,9,8,7,6,5,4,3,2][o]}(r))}};var h={isBrowserWeixin:function(){return"micromessenger"==window.navigator.userAgent.toLowerCase().match(/MicroMessenger/i)},isBrowserIE:function(){if(navigator.userAgent.indexOf("MSIE")>=0&&navigator.userAgent.indexOf("Opera")<0)return!0;var t=!!document.all;return document.all,alert(t),!!/MSIE/i.test(window.navigator.userAgent)||"Microsoft Internet Explorer"!=navigator.appName&&void 0},isDeviceIOS:function(){navigator.userAgent.toLowerCase();var t=navigator.appVersion;return/iphone|ipad|ipod/i.test(t)}},d=__webpack_require__(361);var g={isStrZhOrEn:function(t){return/^[0-9a-zA-Z\u4e00-\u9fa5_-]+$/.test(t)},isStrAbroad:function(t){return/^[a-zA-Z\u4e00-\u9fa5]+([\u00b7\.\- ]?[a-zA-Z\u4e00-\u9fa5]+)*$/.test(t)},isStrEN:function(t){return/^[\u4e00-\u9fa5]+[\u00b7\.]?[\u4e00-\u9fa5]+$/.test(t)},isStrZh:function(t){return/[\u4e00-\u9fa5]+$/.test(t)},isStrCHS:function(t,e){return t.charCodeAt(e)>255||t.charCodeAt(e)<0},isStrRealName:function(t){var e=/^[\u4e00-\u9fa5]{2,6}$/.test(t),r=/^[a-zA-Z]{2,20}$/.test(t),n=/[a-zA-Z0-9\u3000|\s|\t|\uff00-\uffff~!@#¥%……&×()——『』【】、。‘“《》\?\~\!\@\#\$\%\^\&\*\\\+\`\=\[\]\(\)\{\}\|\;\'\:\"\,\/\<\>]+/.test(t);return!!e||(!!r||!n)},isStrEnNum:function(t){return/^[0-9A-Za-z]+$/.test(t)}};var b={isTypeArray:function(t){return"[object Array]"===Object.prototype.toString.call(t)},isTypeBoolean:function(t){return"[object Boolean]"===Object.prototype.toString.call(t)},isTypeDate:function(t){return"[object Date]"===Object.prototype.toString.call(t)},isTypeFunction:function(t){return"[object Function]"===Object.prototype.toString.call(t)},isTypeNull:function(t){return"[object Null]"===Object.prototype.toString.call(t)},isTypeNumber:function(t){return"[object Number]"===Object.prototype.toString.call(t)},isTypeObj:function(t){return"[object Object]"===Object.prototype.toString.call(t)},isTypeRegExp:function(t){return"[object RegExp]"===Object.prototype.toString.call(t)},isTypeString:function(t){return"[object String]"===Object.prototype.toString.call(t)},isTypeUndefined:function(t){return"[object Undefined]"===Object.prototype.toString.call(t)},isTypeJsonString:function(t){try{JSON.parse(t)}catch(t){return!1}return!0}};var y={strTrimSide:function(t){return t?t.replace(/(^\s*)|(\s*$)/g,""):""},strTrimAll:function(t){return t?t.replace(/\s|\xA0/g,""):""},strGetLength:function(t){for(var e=0,r=t.length,n=-1,o=0;o<r;o++)e+=(n=t.charCodeAt(o))>=0&&n<=128?1:2;return e},strLen:function(t){if(!t)return 0;var e=t.match(/[^\x00-\xff]/g);return t.length+(e?e.length:0)},strfeed:function(t){return t?t.replace(/↵/g,"<br/>"):""}};var v={strRandUUID:function(){var t=(new Date).getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var r=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?r:3&r|8).toString(16)}))},strRandomString:function(t){t=t||6;for(var e="ABCDEFGHJKMNPQRSTWXYZabcdefhijkmnprstwxyz2345678",r=e.length,n="",o=0;o<t;o++)n+=e.charAt(Math.floor(Math.random()*r));return n},strRandomWord:function(t,e,r){var n="",o=e,i=["0","1","2","3","4","5","6","7","8","9","a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z","A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"];t&&(o=Math.round(Math.random()*(r-e))+e);var a="";""==(r=r||"")&&(a=(new Date).getTime());for(var u=0;u<o;u++)n+=i[Math.round(Math.random()*(i.length-1))];return n+a},strRandomNum:function(t,e){var r=e-t,n=Math.random();return t+Math.round(n*r)}};var m={strReplace:function(t,e,r){return t?t.replace(new RegExp(e,"g"),r):""},strHideBankNo:function(t){return t?t.replace(/\s/g,"").replace(/(\d{4})\d+(\d{4})$/,"**** **** **** $2"):""},strFormatMoney:function(t){return-1!=(t=t.toString()).indexOf(".")?t.replace(/(\d)(?=(\d{3})+\.)/g,(function(t,e){return e+","})):t.replace(/(\d)(?=(\d{3}))/g,(function(t,e){return e+","}))},strFourSeparate:function(t){return t?t.replace(/(\s)/g,"").replace(/(\d{4})/g,"$1 ").replace(/\s*$/,""):""},strHidePhone:function(t){return t?t.replace(/^(\d{3})\d{4}(\d+)/,"$1****$2"):""},strToChars:function(t){for(var e=new Array,r=0;r<t.length;r++)e[r]=[t.substr(r,1),this.isCHS(t,r)];return t.charsArray=e,e}};var _={uriEncodeQuery:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(!e)return t;var n=t.match(/\?/)?"&":"?",o=Object.keys(e).map((function(t){return"".concat(t,"=").concat(encodeURIComponent(r?JSON.stringify(e[t]):e[t]))})).join("&");return t+n+o},uriDecodeQuery:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},e=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r={};if(t)return Object.keys(t).reduce((function(n,o){return r[o]=decodeURIComponent(t[o]),e&&(r[o]=JSON.parse(r[o])),r}),r)},uriGetParam:function(t){var e=new RegExp("(^|&)"+t+"=([^&]*)(&|$)","i"),r=window.location.search.substr(1).match(e);return null!=r?unescape(r[2]):null},uriDecodeMniQRCode:function(t){for(var e={},r=(t=decodeURIComponent(t)).split("&"),n=0,o=r.length;n<o;n++){var i=r[n].split("=");e[i[0]]=i[1]}return e}},j=_;var w={geoCalcDistance:function(t,e,r,n){var o=arguments.length>4&&void 0!==arguments[4]?arguments[4]:"";if(""==t||""==e)return"未知";var i=t*Math.PI/180,a=r*Math.PI/180,u=i-a,c=e*Math.PI/180-n*Math.PI/180,s=2*Math.asin(Math.sqrt(Math.pow(Math.sin(u/2),2)+Math.cos(i)*Math.cos(a)*Math.pow(Math.sin(c/2),2)));switch(s=(s*=6378.137).toFixed(2),o.toLowerCase()){case"km":s+="km";break;case"m":s=(s*=1e3)<100?"<100m":s+"m";break;default:s>1?s+="km":s=(s*=1e3)<100?"<100m":s+"m"}return s}},O=w;var S={numberAccAdd:function(t,e,r){var n,o,i,a;t=t||0,e=e||0;try{n=t.toString().split(".")[1].length}catch(t){n=0}try{o=e.toString().split(".")[1].length}catch(t){o=0}if(a=Math.abs(n-o),i=Math.pow(10,Math.max(n,o)),a>0){var u=Math.pow(10,a);n>o?(t=Number(t.toString().replace(".","")),e=Number(e.toString().replace(".",""))*u):(t=Number(t.toString().replace(".",""))*u,e=Number(e.toString().replace(".","")))}else t=Number(t.toString().replace(".","")),e=Number(e.toString().replace(".",""));return r||0===r?((t+e)/i).toFixed(r):(t+e)/i},numberAccSub:function(t,e,r){var n,o,i;t=t||0,e=e||0;try{n=t.toString().split(".")[1].length}catch(t){n=0}try{o=e.toString().split(".")[1].length}catch(t){o=0}return((t*(i=Math.pow(10,Math.max(n,o)))-e*i)/i).toFixed(r||0===r?r:n>=o?n:o)},numberAccMul:function(t,e,r){e=e||0;var n=0,o=(t=t||0).toString(),i=e.toString();try{n+=o.split(".")[1].length}catch(t){}try{n+=i.split(".")[1].length}catch(t){}return r||0===r?(Number(o.replace(".",""))*Number(i.replace(".",""))/Math.pow(10,n)).toFixed(r):Number(o.replace(".",""))*Number(i.replace(".",""))/Math.pow(10,n)},numberAccDiv:function(t,e,r){var n,o,i=0,a=0;try{i=t.toString().split(".")[1].length}catch(t){}try{a=e.toString().split(".")[1].length}catch(t){}return n=Number(t.toString().replace(".","")),o=Number(e.toString().replace(".","")),r||0===r?(n/o*Math.pow(10,a-i)).toFixed(r):n/o*Math.pow(10,a-i)}};function x(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function M(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?x(Object(r),!0).forEach((function(e){D(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):x(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function D(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var k=M(M(M(M(M(M(M(M(M(M(M(M(M(M(M({},e),t),a),l),p),h),d.ZP),g),b),y),v),m),j),O),S);function A(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}Date.prototype._diyFormat=function(t){var e={"M+":this.getMonth()+1,"d+":this.getDate(),"h+":this.getHours(),"m+":this.getMinutes(),"s+":this.getSeconds(),"q+":Math.floor((this.getMonth()+3)/3),S:this.getMilliseconds(),"w+":this.getDay(),"a+":this.getDay()};for(var r in/(y+)/.test(t)&&(t=t.replace(RegExp.$1,(this.getFullYear()+"").substr(4-RegExp.$1.length))),e)new RegExp("("+r+")").test(t)&&(t=t.replace(RegExp.$1,1==RegExp.$1.length?e[r]:("00"+e[r]).substr((""+e[r]).length)));return t};var E=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t);var e=new Date;return this.dateObj=e,this.formatType="yyyy-MM-dd hh:mm:ss",this}var e,r,n;return e=t,r=[{key:"setYear",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return 0==t||""==t||this.dateObj.setFullYear(this.dateObj.getFullYear()+t),this}},{key:"setMonth",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return 0==t||""==t||this.dateObj.setMonth(this.dateObj.getMonth()+t),this}},{key:"setDay",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return 0==t||""==t||this.dateObj.setDate(this.dateObj.getDate()+t),this}},{key:"setTime",value:function(t){return""!=(t=t||"")&&(10==t.toString().length&&(t=1e3*parseInt(t)),this.dateObj.setTime(t)),this}},{key:"init",value:function(t){return this}},{key:"format",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"yyyy-MM-dd hh:mm:ss";return""!=(t=t||"")&&(this.formatType=t),this}},{key:"toString",value:function(){return this.dateObj._diyFormat(this.formatType)}},{key:"toObject",value:function(){var t={y:this.dateObj.getFullYear(),m:this.dateObj.getMonth()+1,d:this.dateObj.getDate(),h:this.dateObj.getHours(),i:this.dateObj.getMinutes(),s:this.dateObj.getSeconds(),a:this.dateObj.getDay()};for(var e in t){var r=t[e];"y"!=e&&(t[e]="a"===e?r:String(r<10?"0"+r:r))}return t}},{key:"toArray",value:function(){}},{key:"value",value:function(){var t,e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"string";return"string"==e?0==this.formatType||(t=this.toString()):"object"==e&&(t=this.toObject()),t}}],r&&A(e.prototype,r),n&&A(e,n),Object.defineProperty(e,"prototype",{writable:!1}),t}();function N(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter((function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable}))),r.push.apply(r,n)}return r}function C(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?N(Object(r),!0).forEach((function(e){$(t,e,r[e])})):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):N(Object(r)).forEach((function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))}))}return t}function $(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var P=C(C({},k),{},{LibsDate:function(){return new E}})}(),__webpack_exports__=__webpack_exports__.default,__webpack_exports__}()})); //# sourceMappingURL=index.min.map