From bf069a47a5e82aec5d16d84160fb52b16dbaaf1e Mon Sep 17 00:00:00 2001 From: Xu Liangzhan Date: Sun, 4 Feb 2018 19:55:28 +0800 Subject: [PATCH] update 1.5.0 --- dist/xe-utils.js | 4 ++-- dist/xe-utils.min.js | 4 ++-- index.js | 2 +- package.json | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/dist/xe-utils.js b/dist/xe-utils.js index 2c6dda2..b111aa8 100644 --- a/dist/xe-utils.js +++ b/dist/xe-utils.js @@ -1,5 +1,5 @@ /*! - * xe-utils.js v1.4.1 + * xe-utils.js v1.5.0 * (c) 2017-2018 Xu Liangzhan * ISC License. */ @@ -1215,7 +1215,7 @@ browse: browse, cookie: cookie, locat: locat }) XEUtils.mixin = mixin - XEUtils.version = '1.4.1' + XEUtils.version = '1.5.0' return XEUtils })) diff --git a/dist/xe-utils.min.js b/dist/xe-utils.min.js index 869fc26..fc6b058 100644 --- a/dist/xe-utils.min.js +++ b/dist/xe-utils.min.js @@ -1,8 +1,8 @@ /*! - * xe-utils.js v1.4.1 + * xe-utils.js v1.5.0 * (c) 2017-2018 Xu Liangzhan * ISC License. */ (function(b,a){typeof exports==="object"&&typeof module!=="undefined"?module.exports=a():typeof define==="function"&&define.amd?define(a):(b.XEUtils=a())}(this,function(){var Q=window.isNaN;var ax=window.isFinite;var b=Array.isArray||function(aJ){return Object.prototype.toString.call(aJ)==="[object Array]"};function f(aJ){return aJ!==null&&!Q(aJ)&&!P(aJ)}var P=Number.isInteger;function ar(aJ){return typeof aJ==="function"}function av(aJ){return typeof aJ==="boolean"}function aA(aJ){return typeof aJ==="string"}function I(aJ){return typeof aJ==="number"}function ag(aJ){return aJ?aJ.constructor===RegExp:false}function C(aJ){return typeof aJ==="object"}function A(aJ){return aJ?aJ.constructor===Object:false}function g(aJ){return aJ?aJ.constructor===Date:false}function c(aJ){return aJ?aJ.constructor===Error:false}function ac(aJ){return aJ?aJ.constructor===TypeError:false}function k(aK){if(aK===0||!I(aK)){for(var aJ in aK){return false}return true}return false}function aE(aJ){return aJ===null}function aw(aJ){return typeof Symbol!=="undefined"&&Symbol.isSymbol?Symbol.isSymbol(aJ):(typeof aJ==="symbol")}function d(aJ){return String(aJ)==="[object Arguments]"}function Z(aJ){return aJ&&aA(aJ.nodeName)&&I(aJ.nodeType)}function az(aJ){return aJ&&aJ.nodeType===9}function G(aJ){return aJ&&aJ===aJ.window}function aD(aJ){return typeof FormData!=="undefined"&&aJ instanceof FormData}function ab(aK){var aJ=aK?x(aK):new Date();var aL=aJ.getFullYear();return(aL%4===0)&&(aL%100!==0||aL%400===0)}function u(aJ){if(aJ===null){return""+aJ}if(aw(aJ)){return"symbol"}if(g(aJ)){return"date"}if(b(aJ)){return"array"}return typeof aJ}var B=0;function S(){return ++B}function j(aK){var aJ=0;if(aA(aK)||b(aK)){return aK.length}aF(aK,function(){aJ++});return aJ}function af(aJ){return function(aL,aM){if(aL){if(aA(aL)||b(aL)){return aJ(aL,aM)}for(var aK in aL){if(aM===aL[aK]){return aK}}}return -1}}var l=af(function(aL,aM){if(aL.indexOf){return aL.indexOf(aM)}for(var aK=0,aJ=aL.length;aK=0;aJ--){if(aL===aK[aJ]){return aJ}}return -1});function D(aJ,aK){return l(aJ,aK)!==-1}var M=D;var aI=Object.assign||function(aM){if(aM){for(var aL,aK=1,aJ=arguments.length;aKaM[aL]?1:-1}:function(aN,aM){return aN>aM?1:-1})}return aJ}function m(aN){var aK=[];for(var aM=H(aN),aJ=aM.length-1;aJ>=0;aJ--){var aL=aJ>0?F(0,aJ):0;aK.push(aM[aL]);aM.splice(aL,1)}return aK}function T(aL,aK){var aJ=m(aL);if(arguments.length===1){return aJ[0]}if(aK-1){aJ.push(parseFloat(aL.substring(aP,aP+aN[1])||0)+(aQ.offset||0));break}else{if(aO===aM-1){aJ.push(0)}}}});return new Date(aJ[0],aJ[1],aJ[2],aJ[3],aJ[4],aJ[5],aJ[6])}}return"Invalid Date"}function aa(aL,aN){aL=x(aL);if(g(aL)){var aK=aN||"yyyy-MM-dd HH:mm:ss";var aM=["日","一","二","三","四","五","六"];var aJ={"q+":Math.floor((aL.getMonth()+3)/3),"M+":aL.getMonth()+1,"E+":aL.getDay(),"d+":aL.getDate(),"H+":aL.getHours(),"m+":aL.getMinutes(),"s+":aL.getSeconds(),"S":aL.getMilliseconds()};if(/(y+)/.test(aK)){aK=aK.replace(RegExp.$1,(""+aL.getFullYear()).substr(4-RegExp.$1.length))}aj(t(aJ),function(aO){if(new RegExp("("+aO+")").test(aK)){var aP=""+aJ[aO];aK=aK.replace(RegExp.$1,(aO==="q+"||aO==="E+")?aM[aP]:(RegExp.$1.length===1?aP:("00"+aP).substr(aP.length)))}});return aK}return aL}function O(aL,aQ,aP){var aK=x(aL);var aM=aQ&&!Q(aQ)?aQ:0;var aR=aK.getHours();var aW=aK.getMinutes();var aS=aK.getSeconds();var aJ=aK.getMilliseconds();if(aP==="first"){var aU=aK.getFullYear();var aN=aK.getMonth();if((aN+=aM)<0){return new Date(aU-Math.ceil((aN=Math.abs(aN))/12),12-(aN%12||1),1,aR,aW,aS,aJ)}return new Date(aU+Math.floor(aN/12),aN%12,1,aR,aW,aS,aJ)}else{if(aP==="last"){return new Date(O(aK,aM+1,"first").getTime()-86400000)}}var aT=aK.getDate();var aV=O(aK,aM,"first");var aO=aV.getMonth();aV.setDate(aT);while(aO0?aQ:[["yyyy",31536000000],["MM",2592000000],["dd",86400000],["HH",3600000],["mm",60000],["ss",1000],["S",0]];for(var aO=0,aN=aP.length;aO=aS[1]){if(aO===aN-1){if(aR){aT[aS[0]]=aR}}else{aT[aS[0]]=Math.floor(aR/aS[1]);aR-=aT[aS[0]]*aS[1]}}}}return aT}var w={"&":"&","<":"<",">":">",'"':""","'":"'","`":"`"};var X={};aj(t(w),function(aJ){X[w[aJ]]=aJ});function e(aJ){var aK=new RegExp("(?:"+t(aJ).join("|")+")","g");return function(aL){return String(aL||"").replace(aK,function(aM){return aJ[aM]})}}var ay=e(w);var aB=e(X);function F(aK,aJ){return aK>=aJ?aK:((aK=aK>>0)+Math.round(Math.random()*((aJ||9)-aK)))}function o(aJ,aK){return(ar(aK)?p(aq(aJ,aK,this)):p(aJ,aK))}function N(){return o.apply(this,arguments)[0]}function ak(){return o.apply(this,arguments).reverse()[0]}function ah(){var aJ={};var aK=document.body||document.documentElement;aj(["webkit","khtml","moz","ms","o"],function(aL){aJ["-"+aL]=!!aK[aL+"MatchesSelector"]});return aJ}function L(aL,aN,aK){var aM=[];if(b(aL)){aM=aL}else{if(arguments.length>1){aM=[aI({name:aL,value:aN},aK)]}else{if(C(aL)){aM=[aL]}}}if(aM.length>0){aj(aM,function(aQ){var aP=aI({},aQ);var aO=[];if(aP.name){aO.push(encodeURIComponent(aP.name)+"="+encodeURIComponent(JSON.stringify(aP.value)));if(aP.expires!==undefined){aP.expires=new Date(aH()+parseFloat(aP.expires)*86400000).toUTCString()}aj(["expires","path","domain","secure"],function(aR){if(aP[aR]!==undefined){aO.push(aR+"="+aP[aR])}})}document.cookie=aO.join("; ")})}else{var aJ={};if(document.cookie){aj(document.cookie.split("; "),function(aP){var aO=aP.split("=");aJ[decodeURIComponent(aO[0])]=decodeURIComponent(aO[1]||"")})}return arguments.length===1?aJ[aL]:aJ}}aI(L,{setItem:function(aJ,aK){L(aJ,aK)},getItem:function(aJ){return L(aJ)},removeItem:function(aJ){L(aJ,null,{expires:-1})},getJSON:function(){return L()}});var ae=location;function K(){return(ae.hash.split("#")[1]||"").split("?")[0]||""}function Y(aK){var aJ={};var aL=aK.split("?")[1]||"";if(aL){aj(aL.split("&"),function(aN){var aM=aN.split("=");aJ[decodeURIComponent(aM[0])]=decodeURIComponent(aM[1]||"")})}return aJ}function h(){return{port:ae.port,href:ae.href,host:ae.host,hostname:ae.hostname,protocol:ae.protocol,origin:ae.origin,hash:K(),query:Y(ae.hash),params:Y(ae.search)} -}function W(){}function ap(aJ){return aI(W,aJ)}ap({isNaN:Q,isFinite:ax,isArray:b,isFloat:f,isInteger:P,isFunction:ar,isBoolean:av,isString:aA,isNumber:I,isRegExp:ag,isObject:C,isPlainObject:A,isDate:g,isError:c,isTypeError:ac,isEmpty:k,isNull:aE,isSymbol:aw,isArguments:d,isElement:Z,isDocument:az,isWindow:G,isFormData:aD,isLeapYear:ab,getType:u,uniqueId:S,getSize:j,indexOf:l,lastIndexOf:an,includes:D,contains:M,objectAssign:aI,extend:R,stringToJson:V,jsonToString:am,objectKeys:t,objectValues:H,objectEntries:at,arrayFirst:n,arrayLast:z,objectEach:ao,arrayEach:aj,each:aF,groupBy:U,objectMap:q,clone:y,arrayUniq:ai,arrayUnion:J,arraySort:p,arrayShuffle:m,arraySample:T,arraySome:i,arrayEvery:v,arrayFilter:aG,arrayFind:al,arrayMap:aq,dateNow:aH,stringToDate:x,dateToString:aa,getWhatMonth:O,getWhatWeek:aC,getWhatDay:au,getDaysOfMonth:r,getDateDiff:E,escape:ay,unescape:aB,getRandom:F,arrayMin:N,arrayMax:ak});ap({browse:ah,cookie:L,locat:h});W.mixin=ap;W.version="1.4.1";return W})); \ No newline at end of file +}function W(){}function ap(aJ){return aI(W,aJ)}ap({isNaN:Q,isFinite:ax,isArray:b,isFloat:f,isInteger:P,isFunction:ar,isBoolean:av,isString:aA,isNumber:I,isRegExp:ag,isObject:C,isPlainObject:A,isDate:g,isError:c,isTypeError:ac,isEmpty:k,isNull:aE,isSymbol:aw,isArguments:d,isElement:Z,isDocument:az,isWindow:G,isFormData:aD,isLeapYear:ab,getType:u,uniqueId:S,getSize:j,indexOf:l,lastIndexOf:an,includes:D,contains:M,objectAssign:aI,extend:R,stringToJson:V,jsonToString:am,objectKeys:t,objectValues:H,objectEntries:at,arrayFirst:n,arrayLast:z,objectEach:ao,arrayEach:aj,each:aF,groupBy:U,objectMap:q,clone:y,arrayUniq:ai,arrayUnion:J,arraySort:p,arrayShuffle:m,arraySample:T,arraySome:i,arrayEvery:v,arrayFilter:aG,arrayFind:al,arrayMap:aq,dateNow:aH,stringToDate:x,dateToString:aa,getWhatMonth:O,getWhatWeek:aC,getWhatDay:au,getDaysOfMonth:r,getDateDiff:E,escape:ay,unescape:aB,getRandom:F,arrayMin:N,arrayMax:ak});ap({browse:ah,cookie:L,locat:h});W.mixin=ap;W.version="1.5.0";return W})); \ No newline at end of file diff --git a/index.js b/index.js index d371c20..3247e4d 100644 --- a/index.js +++ b/index.js @@ -15,7 +15,7 @@ function mixin (methods) { mixin(core) mixin(browse) XEUtils.mixin = mixin -XEUtils.version = '1.4.1' +XEUtils.version = '1.5.0' export * from './src/core' export * from './src/browse' diff --git a/package.json b/package.json index d56744d..78355a2 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "xe-utils", - "version": "1.4.1", + "version": "1.5.0", "description": "XEUtils 一个轻量级的函数库,提供一套实用丰富函数", "main": "index.js", "scripts": {