@polyv/utils 1.6.0 → 1.7.0

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/validate.js CHANGED
@@ -1 +1 @@
1
- module.exports=function(t){var n={};function r(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=n,r.d=function(t,n,e){r.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,n){if(1&n&&(t=r(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(r.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)r.d(e,o,function(n){return t[n]}.bind(null,o));return e},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.p="",r(r.s=129)}([function(t,n,r){(function(n){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n&&n)||function(){return this}()||Function("return this")()}).call(this,r(30))},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n){var r={}.hasOwnProperty;t.exports=function(t,n){return r.call(t,n)}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,r){var e=r(3);t.exports=function(t){if(!e(t))throw TypeError(String(t)+" is not an object");return t}},function(t,n,r){var e=r(1);t.exports=!e((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,n,r){var e=r(5),o=r(12),i=r(21);t.exports=e?function(t,n,r){return o.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n,r){var e=r(0),o=r(23),i=r(2),u=r(24),c=r(25),a=r(48),f=o("wks"),l=e.Symbol,s=a?l:l&&l.withoutSetter||u;t.exports=function(t){return i(f,t)||(c&&i(l,t)?f[t]=l[t]:f[t]=s("Symbol."+t)),f[t]}},function(t,n){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,r){var e=r(31),o=r(8);t.exports=function(t){return e(o(t))}},function(t,n,r){var e=r(0),o=r(6),i=r(2),u=r(14),c=r(27),a=r(33),f=a.get,l=a.enforce,s=String(String).split("String");(t.exports=function(t,n,r,c){var a,f=!!c&&!!c.unsafe,p=!!c&&!!c.enumerable,v=!!c&&!!c.noTargetGet;"function"==typeof r&&("string"!=typeof n||i(r,"name")||o(r,"name",n),(a=l(r)).source||(a.source=s.join("string"==typeof n?n:""))),t!==e?(f?!v&&t[n]&&(p=!0):delete t[n],p?t[n]=r:o(t,n,r)):p?t[n]=r:u(n,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&f(this).source||c(this)}))},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n,r){var e=r(5),o=r(26),i=r(4),u=r(18),c=Object.defineProperty;n.f=e?c:function(t,n,r){if(i(t),n=u(n,!0),i(r),o)try{return c(t,n,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[n]=r.value),t}},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},function(t,n,r){var e=r(0),o=r(6);t.exports=function(t,n){try{o(e,t,n)}catch(r){e[t]=n}return n}},function(t,n,r){var e=r(0),o=r(14),i=e["__core-js_shared__"]||o("__core-js_shared__",{});t.exports=i},,function(t,n,r){var e=r(0),o=r(20).f,i=r(6),u=r(10),c=r(14),a=r(44),f=r(36);t.exports=function(t,n){var r,l,s,p,v,g=t.target,h=t.global,d=t.stat;if(r=h?e:d?e[g]||c(g,{}):(e[g]||{}).prototype)for(l in n){if(p=n[l],s=t.noTargetGet?(v=o(r,l))&&v.value:r[l],!f(h?l:g+(d?".":"#")+l,t.forced)&&void 0!==s){if(typeof p==typeof s)continue;a(p,s)}(t.sham||s&&s.sham)&&i(p,"sham",!0),u(r,l,p,t)}}},function(t,n,r){var e=r(3);t.exports=function(t,n){if(!e(t))return t;var r,o;if(n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;if("function"==typeof(r=t.valueOf)&&!e(o=r.call(t)))return o;if(!n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,n,r){var e=r(13),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},function(t,n,r){var e=r(5),o=r(43),i=r(21),u=r(9),c=r(18),a=r(2),f=r(26),l=Object.getOwnPropertyDescriptor;n.f=e?l:function(t,n){if(t=u(t),n=c(n,!0),f)try{return l(t,n)}catch(t){}if(a(t,n))return i(!o.f.call(t,n),t[n])}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n){t.exports={}},function(t,n,r){var e=r(39),o=r(15);(t.exports=function(t,n){return o[t]||(o[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.8.1",mode:e?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(t,n){var r=0,e=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++r+e).toString(36)}},function(t,n,r){var e=r(1);t.exports=!!Object.getOwnPropertySymbols&&!e((function(){return!String(Symbol())}))},function(t,n,r){var e=r(5),o=r(1),i=r(41);t.exports=!e&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(t,n,r){var e=r(15),o=Function.toString;"function"!=typeof e.inspectSource&&(e.inspectSource=function(t){return o.call(t)}),t.exports=e.inspectSource},function(t,n,r){var e=r(45),o=r(0),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,n){return arguments.length<2?i(e[t])||i(o[t]):e[t]&&e[t][n]||o[t]&&o[t][n]}},function(t,n,r){"use strict";var e,o,i=r(37),u=r(59),c=RegExp.prototype.exec,a=String.prototype.replace,f=c,l=(e=/a/,o=/b*/g,c.call(e,"a"),c.call(o,"a"),0!==e.lastIndex||0!==o.lastIndex),s=u.UNSUPPORTED_Y||u.BROKEN_CARET,p=void 0!==/()??/.exec("")[1];(l||p||s)&&(f=function(t){var n,r,e,o,u=this,f=s&&u.sticky,v=i.call(u),g=u.source,h=0,d=t;return f&&(-1===(v=v.replace("y","")).indexOf("g")&&(v+="g"),d=String(t).slice(u.lastIndex),u.lastIndex>0&&(!u.multiline||u.multiline&&"\n"!==t[u.lastIndex-1])&&(g="(?: "+g+")",d=" "+d,h++),r=new RegExp("^(?:"+g+")",v)),p&&(r=new RegExp("^"+g+"$(?!\\s)",v)),l&&(n=u.lastIndex),e=c.call(f?r:u,d),f?e?(e.input=e.input.slice(h),e[0]=e[0].slice(h),e.index=u.lastIndex,u.lastIndex+=e[0].length):u.lastIndex=0:l&&e&&(u.lastIndex=u.global?e.index+e[0].length:n),p&&e&&e.length>1&&a.call(e[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(e[o]=void 0)})),e}),t.exports=f},function(t,n){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,n,r){var e=r(1),o=r(11),i="".split;t.exports=e((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?i.call(t,""):Object(t)}:Object},function(t,n,r){var e=r(42),o=r(35).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return e(t,o)}},function(t,n,r){var e,o,i,u=r(49),c=r(0),a=r(3),f=r(6),l=r(2),s=r(15),p=r(34),v=r(22),g=c.WeakMap;if(u){var h=s.state||(s.state=new g),d=h.get,x=h.has,y=h.set;e=function(t,n){return n.facade=t,y.call(h,t,n),n},o=function(t){return d.call(h,t)||{}},i=function(t){return x.call(h,t)}}else{var b=p("state");v[b]=!0,e=function(t,n){return n.facade=t,f(t,b,n),n},o=function(t){return l(t,b)?t[b]:{}},i=function(t){return l(t,b)}}t.exports={set:e,get:o,has:i,enforce:function(t){return i(t)?o(t):e(t,{})},getterFor:function(t){return function(n){var r;if(!a(n)||(r=o(n)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}}},function(t,n,r){var e=r(23),o=r(24),i=e("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,n){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,n,r){var e=r(1),o=/#|\.prototype\./,i=function(t,n){var r=c[u(t)];return r==f||r!=a&&("function"==typeof n?e(n):!!n)},u=i.normalize=function(t){return String(t).replace(o,".").toLowerCase()},c=i.data={},a=i.NATIVE="N",f=i.POLYFILL="P";t.exports=i},function(t,n,r){"use strict";var e=r(4);t.exports=function(){var t=e(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.dotAll&&(n+="s"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},,function(t,n){t.exports=!1},function(t,n,r){var e=r(9),o=r(19),i=r(46),u=function(t){return function(n,r,u){var c,a=e(n),f=o(a.length),l=i(u,f);if(t&&r!=r){for(;f>l;)if((c=a[l++])!=c)return!0}else for(;f>l;l++)if((t||l in a)&&a[l]===r)return t||l||0;return!t&&-1}};t.exports={includes:u(!0),indexOf:u(!1)}},function(t,n,r){var e=r(0),o=r(3),i=e.document,u=o(i)&&o(i.createElement);t.exports=function(t){return u?i.createElement(t):{}}},function(t,n,r){var e=r(2),o=r(9),i=r(40).indexOf,u=r(22);t.exports=function(t,n){var r,c=o(t),a=0,f=[];for(r in c)!e(u,r)&&e(c,r)&&f.push(r);for(;n.length>a;)e(c,r=n[a++])&&(~i(f,r)||f.push(r));return f}},function(t,n,r){"use strict";var e={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!e.call({1:2},1);n.f=i?function(t){var n=o(this,t);return!!n&&n.enumerable}:e},function(t,n,r){var e=r(2),o=r(50),i=r(20),u=r(12);t.exports=function(t,n){for(var r=o(n),c=u.f,a=i.f,f=0;f<r.length;f++){var l=r[f];e(t,l)||c(t,l,a(n,l))}}},function(t,n,r){var e=r(0);t.exports=e},function(t,n,r){var e=r(13),o=Math.max,i=Math.min;t.exports=function(t,n){var r=e(t);return r<0?o(r+n,0):i(r,n)}},function(t,n){n.f=Object.getOwnPropertySymbols},function(t,n,r){var e=r(25);t.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,n,r){var e=r(0),o=r(27),i=e.WeakMap;t.exports="function"==typeof i&&/native code/.test(o(i))},function(t,n,r){var e=r(28),o=r(32),i=r(47),u=r(4);t.exports=e("Reflect","ownKeys")||function(t){var n=o.f(u(t)),r=i.f;return r?n.concat(r(t)):n}},function(t,n,r){var e=r(8);t.exports=function(t){return Object(e(t))}},function(t,n,r){"use strict";var e=r(17),o=r(29);e({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},,,,function(t,n,r){"use strict";r(52);var e=r(10),o=r(1),i=r(7),u=r(29),c=r(6),a=i("species"),f=!o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),l="$0"==="a".replace(/./,"$0"),s=i("replace"),p=!!/./[s]&&""===/./[s]("a","$0"),v=!o((function(){var t=/(?:)/,n=t.exec;t.exec=function(){return n.apply(this,arguments)};var r="ab".split(t);return 2!==r.length||"a"!==r[0]||"b"!==r[1]}));t.exports=function(t,n,r,s){var g=i(t),h=!o((function(){var n={};return n[g]=function(){return 7},7!=""[t](n)})),d=h&&!o((function(){var n=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[a]=function(){return r},r.flags="",r[g]=/./[g]),r.exec=function(){return n=!0,null},r[g](""),!n}));if(!h||!d||"replace"===t&&(!f||!l||p)||"split"===t&&!v){var x=/./[g],y=r(g,""[t],(function(t,n,r,e,o){return n.exec===u?h&&!o?{done:!0,value:x.call(n,r,e)}:{done:!0,value:t.call(r,n,e)}:{done:!1}}),{REPLACE_KEEPS_$0:l,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:p}),b=y[0],E=y[1];e(String.prototype,t,b),e(RegExp.prototype,g,2==n?function(t,n){return E.call(t,this,n)}:function(t){return E.call(t,this)})}s&&c(RegExp.prototype[g],"sham",!0)}},function(t,n,r){"use strict";var e=r(63).charAt;t.exports=function(t,n,r){return n+(r?e(t,n).length:1)}},function(t,n,r){var e=r(11),o=r(29);t.exports=function(t,n){var r=t.exec;if("function"==typeof r){var i=r.call(t,n);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==e(t))throw TypeError("RegExp#exec called on incompatible receiver");return o.call(t,n)}},function(t,n,r){"use strict";var e=r(1);function o(t,n){return RegExp(t,n)}n.UNSUPPORTED_Y=e((function(){var t=o("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),n.BROKEN_CARET=e((function(){var t=o("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},,,function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,n,r){var e=r(13),o=r(8),i=function(t){return function(n,r){var i,u,c=String(o(n)),a=e(r),f=c.length;return a<0||a>=f?t?"":void 0:(i=c.charCodeAt(a))<55296||i>56319||a+1===f||(u=c.charCodeAt(a+1))<56320||u>57343?t?c.charAt(a):i:t?c.slice(a,a+2):u-56320+(i-55296<<10)+65536}};t.exports={codeAt:i(!1),charAt:i(!0)}},,,function(t,n,r){"use strict";var e=r(56),o=r(4),i=r(51),u=r(19),c=r(13),a=r(8),f=r(57),l=r(58),s=Math.max,p=Math.min,v=Math.floor,g=/\$([$&'`]|\d\d?|<[^>]*>)/g,h=/\$([$&'`]|\d\d?)/g;e("replace",2,(function(t,n,r,e){var d=e.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,x=e.REPLACE_KEEPS_$0,y=d?"$":"$0";return[function(r,e){var o=a(this),i=null==r?void 0:r[t];return void 0!==i?i.call(r,o,e):n.call(String(o),r,e)},function(t,e){if(!d&&x||"string"==typeof e&&-1===e.indexOf(y)){var i=r(n,t,this,e);if(i.done)return i.value}var a=o(t),v=String(this),g="function"==typeof e;g||(e=String(e));var h=a.global;if(h){var E=a.unicode;a.lastIndex=0}for(var m=[];;){var S=l(a,v);if(null===S)break;if(m.push(S),!h)break;""===String(S[0])&&(a.lastIndex=f(v,u(a.lastIndex),E))}for(var w,O="",_=0,P=0;P<m.length;P++){S=m[P];for(var j=String(S[0]),I=s(p(c(S.index),v.length),0),R=[],T=1;T<S.length;T++)R.push(void 0===(w=S[T])?w:String(w));var A=S.groups;if(g){var M=[j].concat(R,I,v);void 0!==A&&M.push(A);var $=String(e.apply(void 0,M))}else $=b(j,v,I,R,A,e);I>=_&&(O+=v.slice(_,I)+$,_=I+j.length)}return O+v.slice(_)}];function b(t,r,e,o,u,c){var a=e+t.length,f=o.length,l=h;return void 0!==u&&(u=i(u),l=g),n.call(c,l,(function(n,i){var c;switch(i.charAt(0)){case"$":return"$";case"&":return t;case"`":return r.slice(0,e);case"'":return r.slice(a);case"<":c=u[i.slice(1,-1)];break;default:var l=+i;if(0===l)return n;if(l>f){var s=v(l/10);return 0===s?n:s<=f?void 0===o[s-1]?i.charAt(1):o[s-1]+i.charAt(1):n}c=o[l-1]}return void 0===c?"":c}))}}))},,,,,function(t,n,r){var e=r(3),o=r(11),i=r(7)("match");t.exports=function(t){var n;return e(t)&&(void 0!==(n=t[i])?!!n:"RegExp"==o(t))}},,,,,,,,function(t,n,r){"use strict";var e=r(56),o=r(71),i=r(4),u=r(8),c=r(80),a=r(57),f=r(19),l=r(58),s=r(29),p=r(1),v=[].push,g=Math.min,h=!p((function(){return!RegExp(4294967295,"y")}));e("split",2,(function(t,n,r){var e;return e="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,r){var e=String(u(this)),i=void 0===r?4294967295:r>>>0;if(0===i)return[];if(void 0===t)return[e];if(!o(t))return n.call(e,t,i);for(var c,a,f,l=[],p=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),g=0,h=new RegExp(t.source,p+"g");(c=s.call(h,e))&&!((a=h.lastIndex)>g&&(l.push(e.slice(g,c.index)),c.length>1&&c.index<e.length&&v.apply(l,c.slice(1)),f=c[0].length,g=a,l.length>=i));)h.lastIndex===c.index&&h.lastIndex++;return g===e.length?!f&&h.test("")||l.push(""):l.push(e.slice(g)),l.length>i?l.slice(0,i):l}:"0".split(void 0,0).length?function(t,r){return void 0===t&&0===r?[]:n.call(this,t,r)}:n,[function(n,r){var o=u(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,o,r):e.call(String(o),n,r)},function(t,o){var u=r(e,t,this,o,e!==n);if(u.done)return u.value;var s=i(t),p=String(this),v=c(s,RegExp),d=s.unicode,x=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(h?"y":"g"),y=new v(h?s:"^(?:"+s.source+")",x),b=void 0===o?4294967295:o>>>0;if(0===b)return[];if(0===p.length)return null===l(y,p)?[p]:[];for(var E=0,m=0,S=[];m<p.length;){y.lastIndex=h?m:0;var w,O=l(y,h?p:p.slice(m));if(null===O||(w=g(f(y.lastIndex+(h?0:m)),p.length))===E)m=a(p,m,d);else{if(S.push(p.slice(E,m)),S.length===b)return S;for(var _=1;_<=O.length-1;_++)if(S.push(O[_]),S.length===b)return S;m=E=w}}return S.push(p.slice(E)),S}]}),!h)},function(t,n,r){var e=r(4),o=r(62),i=r(7)("species");t.exports=function(t,n){var r,u=e(t).constructor;return void 0===u||null==(r=e(u)[i])?n:o(r)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,n,r){"use strict";r.r(n),r.d(n,"isPhoneNO",(function(){return e})),r.d(n,"isEmail",(function(){return o}));r(52),r(66),r(79);function e(t){return/^1[3-9]\d{9}$/.test(t)}function o(t){var n=/^[\w-]+(?:\.[\w-]+)*@[\w-]+(?:\.[\w-]+)*\.[a-zA-Z]{2,}$/.test(t);if(n){for(var r=(n=t.replace("@",".").split(".")).length-1;r>=0;r--)if(/^[-_]/.test(n[r])||/[_-]$/.test(n[r]))return!1;return!0}return!1}}]);
1
+ module.exports=function(t){var n={};function r(e){if(n[e])return n[e].exports;var o=n[e]={i:e,l:!1,exports:{}};return t[e].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=n,r.d=function(t,n,e){r.o(t,n)||Object.defineProperty(t,n,{enumerable:!0,get:e})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,n){if(1&n&&(t=r(t)),8&n)return t;if(4&n&&"object"==typeof t&&t&&t.__esModule)return t;var e=Object.create(null);if(r.r(e),Object.defineProperty(e,"default",{enumerable:!0,value:t}),2&n&&"string"!=typeof t)for(var o in t)r.d(e,o,function(n){return t[n]}.bind(null,o));return e},r.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(n,"a",n),n},r.o=function(t,n){return Object.prototype.hasOwnProperty.call(t,n)},r.p="",r(r.s=129)}([function(t,n,r){(function(n){var r=function(t){return t&&t.Math==Math&&t};t.exports=r("object"==typeof globalThis&&globalThis)||r("object"==typeof window&&window)||r("object"==typeof self&&self)||r("object"==typeof n&&n)||function(){return this}()||Function("return this")()}).call(this,r(30))},function(t,n){t.exports=function(t){try{return!!t()}catch(t){return!0}}},function(t,n){var r={}.hasOwnProperty;t.exports=function(t,n){return r.call(t,n)}},function(t,n){t.exports=function(t){return"object"==typeof t?null!==t:"function"==typeof t}},function(t,n,r){var e=r(3);t.exports=function(t){if(!e(t))throw TypeError(String(t)+" is not an object");return t}},function(t,n,r){var e=r(1);t.exports=!e((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]}))},function(t,n,r){var e=r(5),o=r(12),i=r(21);t.exports=e?function(t,n,r){return o.f(t,n,i(1,r))}:function(t,n,r){return t[n]=r,t}},function(t,n,r){var e=r(0),o=r(23),i=r(2),u=r(24),c=r(25),a=r(48),f=o("wks"),l=e.Symbol,s=a?l:l&&l.withoutSetter||u;t.exports=function(t){return i(f,t)||(c&&i(l,t)?f[t]=l[t]:f[t]=s("Symbol."+t)),f[t]}},function(t,n){t.exports=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t}},function(t,n,r){var e=r(31),o=r(8);t.exports=function(t){return e(o(t))}},function(t,n,r){var e=r(0),o=r(6),i=r(2),u=r(14),c=r(27),a=r(33),f=a.get,l=a.enforce,s=String(String).split("String");(t.exports=function(t,n,r,c){var a,f=!!c&&!!c.unsafe,p=!!c&&!!c.enumerable,v=!!c&&!!c.noTargetGet;"function"==typeof r&&("string"!=typeof n||i(r,"name")||o(r,"name",n),(a=l(r)).source||(a.source=s.join("string"==typeof n?n:""))),t!==e?(f?!v&&t[n]&&(p=!0):delete t[n],p?t[n]=r:o(t,n,r)):p?t[n]=r:u(n,r)})(Function.prototype,"toString",(function(){return"function"==typeof this&&f(this).source||c(this)}))},function(t,n){var r={}.toString;t.exports=function(t){return r.call(t).slice(8,-1)}},function(t,n,r){var e=r(5),o=r(26),i=r(4),u=r(18),c=Object.defineProperty;n.f=e?c:function(t,n,r){if(i(t),n=u(n,!0),i(r),o)try{return c(t,n,r)}catch(t){}if("get"in r||"set"in r)throw TypeError("Accessors not supported");return"value"in r&&(t[n]=r.value),t}},function(t,n){var r=Math.ceil,e=Math.floor;t.exports=function(t){return isNaN(t=+t)?0:(t>0?e:r)(t)}},function(t,n,r){var e=r(0),o=r(6);t.exports=function(t,n){try{o(e,t,n)}catch(r){e[t]=n}return n}},function(t,n,r){var e=r(0),o=r(14),i=e["__core-js_shared__"]||o("__core-js_shared__",{});t.exports=i},function(t,n,r){var e=r(0),o=r(20).f,i=r(6),u=r(10),c=r(14),a=r(44),f=r(37);t.exports=function(t,n){var r,l,s,p,v,g=t.target,h=t.global,d=t.stat;if(r=h?e:d?e[g]||c(g,{}):(e[g]||{}).prototype)for(l in n){if(p=n[l],s=t.noTargetGet?(v=o(r,l))&&v.value:r[l],!f(h?l:g+(d?".":"#")+l,t.forced)&&void 0!==s){if(typeof p==typeof s)continue;a(p,s)}(t.sham||s&&s.sham)&&i(p,"sham",!0),u(r,l,p,t)}}},,function(t,n,r){var e=r(3);t.exports=function(t,n){if(!e(t))return t;var r,o;if(n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;if("function"==typeof(r=t.valueOf)&&!e(o=r.call(t)))return o;if(!n&&"function"==typeof(r=t.toString)&&!e(o=r.call(t)))return o;throw TypeError("Can't convert object to primitive value")}},function(t,n,r){var e=r(13),o=Math.min;t.exports=function(t){return t>0?o(e(t),9007199254740991):0}},function(t,n,r){var e=r(5),o=r(43),i=r(21),u=r(9),c=r(18),a=r(2),f=r(26),l=Object.getOwnPropertyDescriptor;n.f=e?l:function(t,n){if(t=u(t),n=c(n,!0),f)try{return l(t,n)}catch(t){}if(a(t,n))return i(!o.f.call(t,n),t[n])}},function(t,n){t.exports=function(t,n){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:n}}},function(t,n){t.exports={}},function(t,n,r){var e=r(40),o=r(15);(t.exports=function(t,n){return o[t]||(o[t]=void 0!==n?n:{})})("versions",[]).push({version:"3.8.1",mode:e?"pure":"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})},function(t,n){var r=0,e=Math.random();t.exports=function(t){return"Symbol("+String(void 0===t?"":t)+")_"+(++r+e).toString(36)}},function(t,n,r){var e=r(1);t.exports=!!Object.getOwnPropertySymbols&&!e((function(){return!String(Symbol())}))},function(t,n,r){var e=r(5),o=r(1),i=r(41);t.exports=!e&&!o((function(){return 7!=Object.defineProperty(i("div"),"a",{get:function(){return 7}}).a}))},function(t,n,r){var e=r(15),o=Function.toString;"function"!=typeof e.inspectSource&&(e.inspectSource=function(t){return o.call(t)}),t.exports=e.inspectSource},function(t,n,r){var e=r(45),o=r(0),i=function(t){return"function"==typeof t?t:void 0};t.exports=function(t,n){return arguments.length<2?i(e[t])||i(o[t]):e[t]&&e[t][n]||o[t]&&o[t][n]}},function(t,n,r){"use strict";var e,o,i=r(38),u=r(61),c=RegExp.prototype.exec,a=String.prototype.replace,f=c,l=(e=/a/,o=/b*/g,c.call(e,"a"),c.call(o,"a"),0!==e.lastIndex||0!==o.lastIndex),s=u.UNSUPPORTED_Y||u.BROKEN_CARET,p=void 0!==/()??/.exec("")[1];(l||p||s)&&(f=function(t){var n,r,e,o,u=this,f=s&&u.sticky,v=i.call(u),g=u.source,h=0,d=t;return f&&(-1===(v=v.replace("y","")).indexOf("g")&&(v+="g"),d=String(t).slice(u.lastIndex),u.lastIndex>0&&(!u.multiline||u.multiline&&"\n"!==t[u.lastIndex-1])&&(g="(?: "+g+")",d=" "+d,h++),r=new RegExp("^(?:"+g+")",v)),p&&(r=new RegExp("^"+g+"$(?!\\s)",v)),l&&(n=u.lastIndex),e=c.call(f?r:u,d),f?e?(e.input=e.input.slice(h),e[0]=e[0].slice(h),e.index=u.lastIndex,u.lastIndex+=e[0].length):u.lastIndex=0:l&&e&&(u.lastIndex=u.global?e.index+e[0].length:n),p&&e&&e.length>1&&a.call(e[0],r,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(e[o]=void 0)})),e}),t.exports=f},function(t,n){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,n,r){var e=r(1),o=r(11),i="".split;t.exports=e((function(){return!Object("z").propertyIsEnumerable(0)}))?function(t){return"String"==o(t)?i.call(t,""):Object(t)}:Object},function(t,n,r){var e=r(42),o=r(36).concat("length","prototype");n.f=Object.getOwnPropertyNames||function(t){return e(t,o)}},function(t,n,r){var e,o,i,u=r(49),c=r(0),a=r(3),f=r(6),l=r(2),s=r(15),p=r(34),v=r(22),g=c.WeakMap;if(u){var h=s.state||(s.state=new g),d=h.get,x=h.has,y=h.set;e=function(t,n){return n.facade=t,y.call(h,t,n),n},o=function(t){return d.call(h,t)||{}},i=function(t){return x.call(h,t)}}else{var b=p("state");v[b]=!0,e=function(t,n){return n.facade=t,f(t,b,n),n},o=function(t){return l(t,b)?t[b]:{}},i=function(t){return l(t,b)}}t.exports={set:e,get:o,has:i,enforce:function(t){return i(t)?o(t):e(t,{})},getterFor:function(t){return function(n){var r;if(!a(n)||(r=o(n)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return r}}}},function(t,n,r){var e=r(23),o=r(24),i=e("keys");t.exports=function(t){return i[t]||(i[t]=o(t))}},function(t,n,r){var e=r(9),o=r(19),i=r(46),u=function(t){return function(n,r,u){var c,a=e(n),f=o(a.length),l=i(u,f);if(t&&r!=r){for(;f>l;)if((c=a[l++])!=c)return!0}else for(;f>l;l++)if((t||l in a)&&a[l]===r)return t||l||0;return!t&&-1}};t.exports={includes:u(!0),indexOf:u(!1)}},function(t,n){t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},function(t,n,r){var e=r(1),o=/#|\.prototype\./,i=function(t,n){var r=c[u(t)];return r==f||r!=a&&("function"==typeof n?e(n):!!n)},u=i.normalize=function(t){return String(t).replace(o,".").toLowerCase()},c=i.data={},a=i.NATIVE="N",f=i.POLYFILL="P";t.exports=i},function(t,n,r){"use strict";var e=r(4);t.exports=function(){var t=e(this),n="";return t.global&&(n+="g"),t.ignoreCase&&(n+="i"),t.multiline&&(n+="m"),t.dotAll&&(n+="s"),t.unicode&&(n+="u"),t.sticky&&(n+="y"),n}},,function(t,n){t.exports=!1},function(t,n,r){var e=r(0),o=r(3),i=e.document,u=o(i)&&o(i.createElement);t.exports=function(t){return u?i.createElement(t):{}}},function(t,n,r){var e=r(2),o=r(9),i=r(35).indexOf,u=r(22);t.exports=function(t,n){var r,c=o(t),a=0,f=[];for(r in c)!e(u,r)&&e(c,r)&&f.push(r);for(;n.length>a;)e(c,r=n[a++])&&(~i(f,r)||f.push(r));return f}},function(t,n,r){"use strict";var e={}.propertyIsEnumerable,o=Object.getOwnPropertyDescriptor,i=o&&!e.call({1:2},1);n.f=i?function(t){var n=o(this,t);return!!n&&n.enumerable}:e},function(t,n,r){var e=r(2),o=r(50),i=r(20),u=r(12);t.exports=function(t,n){for(var r=o(n),c=u.f,a=i.f,f=0;f<r.length;f++){var l=r[f];e(t,l)||c(t,l,a(n,l))}}},function(t,n,r){var e=r(0);t.exports=e},function(t,n,r){var e=r(13),o=Math.max,i=Math.min;t.exports=function(t,n){var r=e(t);return r<0?o(r+n,0):i(r,n)}},function(t,n){n.f=Object.getOwnPropertySymbols},function(t,n,r){var e=r(25);t.exports=e&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},function(t,n,r){var e=r(0),o=r(27),i=e.WeakMap;t.exports="function"==typeof i&&/native code/.test(o(i))},function(t,n,r){var e=r(28),o=r(32),i=r(47),u=r(4);t.exports=e("Reflect","ownKeys")||function(t){var n=o.f(u(t)),r=i.f;return r?n.concat(r(t)):n}},function(t,n,r){var e=r(8);t.exports=function(t){return Object(e(t))}},function(t,n,r){"use strict";var e=r(16),o=r(29);e({target:"RegExp",proto:!0,forced:/./.exec!==o},{exec:o})},,,,function(t,n,r){"use strict";r(52);var e=r(10),o=r(1),i=r(7),u=r(29),c=r(6),a=i("species"),f=!o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$<a>")})),l="$0"==="a".replace(/./,"$0"),s=i("replace"),p=!!/./[s]&&""===/./[s]("a","$0"),v=!o((function(){var t=/(?:)/,n=t.exec;t.exec=function(){return n.apply(this,arguments)};var r="ab".split(t);return 2!==r.length||"a"!==r[0]||"b"!==r[1]}));t.exports=function(t,n,r,s){var g=i(t),h=!o((function(){var n={};return n[g]=function(){return 7},7!=""[t](n)})),d=h&&!o((function(){var n=!1,r=/a/;return"split"===t&&((r={}).constructor={},r.constructor[a]=function(){return r},r.flags="",r[g]=/./[g]),r.exec=function(){return n=!0,null},r[g](""),!n}));if(!h||!d||"replace"===t&&(!f||!l||p)||"split"===t&&!v){var x=/./[g],y=r(g,""[t],(function(t,n,r,e,o){return n.exec===u?h&&!o?{done:!0,value:x.call(n,r,e)}:{done:!0,value:t.call(r,n,e)}:{done:!1}}),{REPLACE_KEEPS_$0:l,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:p}),b=y[0],E=y[1];e(String.prototype,t,b),e(RegExp.prototype,g,2==n?function(t,n){return E.call(t,this,n)}:function(t){return E.call(t,this)})}s&&c(RegExp.prototype[g],"sham",!0)}},function(t,n,r){"use strict";var e=r(65).charAt;t.exports=function(t,n,r){return n+(r?e(t,n).length:1)}},function(t,n,r){var e=r(11),o=r(29);t.exports=function(t,n){var r=t.exec;if("function"==typeof r){var i=r.call(t,n);if("object"!=typeof i)throw TypeError("RegExp exec method returned something other than an Object or null");return i}if("RegExp"!==e(t))throw TypeError("RegExp#exec called on incompatible receiver");return o.call(t,n)}},,,function(t,n,r){"use strict";var e=r(1);function o(t,n){return RegExp(t,n)}n.UNSUPPORTED_Y=e((function(){var t=o("a","y");return t.lastIndex=2,null!=t.exec("abcd")})),n.BROKEN_CARET=e((function(){var t=o("^r","gy");return t.lastIndex=2,null!=t.exec("str")}))},,,function(t,n){t.exports=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t}},function(t,n,r){var e=r(13),o=r(8),i=function(t){return function(n,r){var i,u,c=String(o(n)),a=e(r),f=c.length;return a<0||a>=f?t?"":void 0:(i=c.charCodeAt(a))<55296||i>56319||a+1===f||(u=c.charCodeAt(a+1))<56320||u>57343?t?c.charAt(a):i:t?c.slice(a,a+2):u-56320+(i-55296<<10)+65536}};t.exports={codeAt:i(!1),charAt:i(!0)}},function(t,n,r){"use strict";var e=r(56),o=r(4),i=r(51),u=r(19),c=r(13),a=r(8),f=r(57),l=r(58),s=Math.max,p=Math.min,v=Math.floor,g=/\$([$&'`]|\d\d?|<[^>]*>)/g,h=/\$([$&'`]|\d\d?)/g;e("replace",2,(function(t,n,r,e){var d=e.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,x=e.REPLACE_KEEPS_$0,y=d?"$":"$0";return[function(r,e){var o=a(this),i=null==r?void 0:r[t];return void 0!==i?i.call(r,o,e):n.call(String(o),r,e)},function(t,e){if(!d&&x||"string"==typeof e&&-1===e.indexOf(y)){var i=r(n,t,this,e);if(i.done)return i.value}var a=o(t),v=String(this),g="function"==typeof e;g||(e=String(e));var h=a.global;if(h){var E=a.unicode;a.lastIndex=0}for(var m=[];;){var S=l(a,v);if(null===S)break;if(m.push(S),!h)break;""===String(S[0])&&(a.lastIndex=f(v,u(a.lastIndex),E))}for(var w,O="",_=0,P=0;P<m.length;P++){S=m[P];for(var j=String(S[0]),I=s(p(c(S.index),v.length),0),R=[],T=1;T<S.length;T++)R.push(void 0===(w=S[T])?w:String(w));var A=S.groups;if(g){var M=[j].concat(R,I,v);void 0!==A&&M.push(A);var $=String(e.apply(void 0,M))}else $=b(j,v,I,R,A,e);I>=_&&(O+=v.slice(_,I)+$,_=I+j.length)}return O+v.slice(_)}];function b(t,r,e,o,u,c){var a=e+t.length,f=o.length,l=h;return void 0!==u&&(u=i(u),l=g),n.call(c,l,(function(n,i){var c;switch(i.charAt(0)){case"$":return"$";case"&":return t;case"`":return r.slice(0,e);case"'":return r.slice(a);case"<":c=u[i.slice(1,-1)];break;default:var l=+i;if(0===l)return n;if(l>f){var s=v(l/10);return 0===s?n:s<=f?void 0===o[s-1]?i.charAt(1):o[s-1]+i.charAt(1):n}c=o[l-1]}return void 0===c?"":c}))}}))},,,,,function(t,n,r){var e=r(3),o=r(11),i=r(7)("match");t.exports=function(t){var n;return e(t)&&(void 0!==(n=t[i])?!!n:"RegExp"==o(t))}},,,,,,,,,function(t,n,r){"use strict";var e=r(56),o=r(71),i=r(4),u=r(8),c=r(81),a=r(57),f=r(19),l=r(58),s=r(29),p=r(1),v=[].push,g=Math.min,h=!p((function(){return!RegExp(4294967295,"y")}));e("split",2,(function(t,n,r){var e;return e="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(t,r){var e=String(u(this)),i=void 0===r?4294967295:r>>>0;if(0===i)return[];if(void 0===t)return[e];if(!o(t))return n.call(e,t,i);for(var c,a,f,l=[],p=(t.ignoreCase?"i":"")+(t.multiline?"m":"")+(t.unicode?"u":"")+(t.sticky?"y":""),g=0,h=new RegExp(t.source,p+"g");(c=s.call(h,e))&&!((a=h.lastIndex)>g&&(l.push(e.slice(g,c.index)),c.length>1&&c.index<e.length&&v.apply(l,c.slice(1)),f=c[0].length,g=a,l.length>=i));)h.lastIndex===c.index&&h.lastIndex++;return g===e.length?!f&&h.test("")||l.push(""):l.push(e.slice(g)),l.length>i?l.slice(0,i):l}:"0".split(void 0,0).length?function(t,r){return void 0===t&&0===r?[]:n.call(this,t,r)}:n,[function(n,r){var o=u(this),i=null==n?void 0:n[t];return void 0!==i?i.call(n,o,r):e.call(String(o),n,r)},function(t,o){var u=r(e,t,this,o,e!==n);if(u.done)return u.value;var s=i(t),p=String(this),v=c(s,RegExp),d=s.unicode,x=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(h?"y":"g"),y=new v(h?s:"^(?:"+s.source+")",x),b=void 0===o?4294967295:o>>>0;if(0===b)return[];if(0===p.length)return null===l(y,p)?[p]:[];for(var E=0,m=0,S=[];m<p.length;){y.lastIndex=h?m:0;var w,O=l(y,h?p:p.slice(m));if(null===O||(w=g(f(y.lastIndex+(h?0:m)),p.length))===E)m=a(p,m,d);else{if(S.push(p.slice(E,m)),S.length===b)return S;for(var _=1;_<=O.length-1;_++)if(S.push(O[_]),S.length===b)return S;m=E=w}}return S.push(p.slice(E)),S}]}),!h)},function(t,n,r){var e=r(4),o=r(64),i=r(7)("species");t.exports=function(t,n){var r,u=e(t).constructor;return void 0===u||null==(r=e(u)[i])?n:o(r)}},,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,function(t,n,r){"use strict";r.r(n),r.d(n,"isPhoneNO",(function(){return e})),r.d(n,"isEmail",(function(){return o}));r(52),r(66),r(80);function e(t){return/^1[3-9]\d{9}$/.test(t)}function o(t){var n=/^[\w-]+(?:\.[\w-]+)*@[\w-]+(?:\.[\w-]+)*\.[a-zA-Z]{2,}$/.test(t);if(n){for(var r=(n=t.replace("@",".").split(".")).length-1;r>=0;r--)if(/^[-_]/.test(n[r])||/[_-]$/.test(n[r]))return!1;return!0}return!1}}]);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@polyv/utils",
3
- "version": "1.6.0",
3
+ "version": "1.7.0",
4
4
  "description": "Utility functions of Polyv frontend development.",
5
5
  "keywords": [
6
6
  "polyv",
@@ -48,7 +48,7 @@
48
48
  "eslint-plugin-sonarjs": "^0.5.0",
49
49
  "glob": "^7.1.6",
50
50
  "html-webpack-plugin": "^4.5.0",
51
- "jsdoc": "^3.6.6",
51
+ "jsdoc": "^3.6.10",
52
52
  "regenerator-runtime": "^0.13.7",
53
53
  "rimraf": "^3.0.2",
54
54
  "webpack": "^4.44.2",
package/src/browser.js CHANGED
@@ -12,14 +12,38 @@ function getBrowserUA(ua) {
12
12
  }
13
13
 
14
14
  /**
15
- * 检查指定 useragent 字符串是否符合移动端设备特征。
15
+ * 检查当前设备是否移动设备。
16
16
  * @author luoliquan
17
17
  * @param {string} [ua] useragent 字符串,浏览器环境下默认为 navigator.userAgent。
18
- * @return {boolean} 是否符合移动端设备特征。
18
+ * @param {Object} [features] 浏览器特征。
19
+ * @param {string} [features.platform] 运行平台。
20
+ * @param {string} [features.maxTouchPoints] 最大触点数。
21
+ * @return {boolean} 当前设备是否移动设备。
22
+ * @example
23
+ * isMobile(navigator.userAgent);
24
+ * isMobile(navigator.userAgent, {
25
+ * platform: navigator.platform,
26
+ * maxTouchPoints: navigator.maxTouchPoints
27
+ * });
19
28
  */
20
- export function isMobile(ua) {
29
+ export function isMobile(ua, features) {
21
30
  ua = getBrowserUA(ua);
22
- return /mobile|android/i.test(ua) || !/\b(Windows\sNT|Macintosh|Linux)\b/.test(ua);
31
+ let result = /mobile|android/i.test(ua) ||
32
+ !/\b(Windows\sNT|Macintosh|Linux)\b/.test(ua);
33
+
34
+ if (features && 'platform' in features) {
35
+ result = result || [
36
+ 'Android', 'iPhone', 'iPad', 'iPod'
37
+ ].indexOf(features.platform) !== -1;
38
+
39
+ if ('maxTouchPoints' in features) {
40
+ result = result || (
41
+ features.platform === 'MacIntel' && features.maxTouchPoints > 1
42
+ );
43
+ }
44
+ }
45
+
46
+ return result;
23
47
  }
24
48
 
25
49
  /**
package/src/countdown.js CHANGED
@@ -4,10 +4,10 @@
4
4
  */
5
5
 
6
6
  const computes = [
7
- { divisor: 24 * 60 * 60 * 1000, unit: 'days' },
8
- { divisor: 60 * 60 * 1000, unit: 'hours' },
9
- { divisor: 60 * 1000, unit: 'minutes' },
10
- { divisor: 1000, unit: 'seconds' }
7
+ { divisor: 24 * 60 * 60, unit: 'days' },
8
+ { divisor: 60 * 60, unit: 'hours' },
9
+ { divisor: 60, unit: 'minutes' },
10
+ { divisor: 1, unit: 'seconds' }
11
11
  ];
12
12
 
13
13
  /**
@@ -55,6 +55,7 @@ export default class Countdown {
55
55
  const rest = {
56
56
  totalMsecs: value
57
57
  };
58
+ value = Math.round(value / 1000);
58
59
  computes.forEach((item, i) => {
59
60
  rest[item.unit] = value / item.divisor;
60
61
  if (i === computes.length - 1) {
@@ -117,5 +117,7 @@ export function append(url, data, options) {
117
117
  data = data.replace(/^[?&]/, '');
118
118
  }
119
119
 
120
- return url + (url.indexOf('?') !== -1 ? '&' : '?') + data + hash;
120
+ return url + (
121
+ data ? ((url.indexOf('?') !== -1 ? '&' : '?') + data) : ''
122
+ ) + hash;
121
123
  }