js_ryl 1.0.28 → 1.0.29

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/README.md CHANGED
@@ -203,6 +203,7 @@
203
203
  #1.0.22: 数据补全方法优化
204
204
  #1.0.25: 新增了emoji,highLight方法
205
205
  #1.0.28: 商品飞入购物车效果
206
+ #1.0.29: 拷贝方法优化
206
207
  ```
207
208
 
208
209
  For detailed explanation on how things work, consult the [docs for vue-loader](http://vuejs.github.io/vue-loader).
package/dist/build.js CHANGED
@@ -1 +1 @@
1
- !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("js_ryl",[],e):"object"==typeof exports?exports.js_ryl=e():t.js_ryl=e()}("undefined"!=typeof self?self:this,function(){return function(t){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}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get: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,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),o=n(2),i=n(3),a=n(4),u=n(5),c=n(6),s=n(7),l=n(8),f=n(9),p=n(10),d=n(11),m=n(12),h=n(13);e.default={reg:r.a,time:o.a,cookie:i.a,fun:a.a,num:u.a,copy:c.a,deepCopy:s.a,verCode:l.a,filterTable:f.a,getMonthDays:p.a,emoji:d.a,highLight:m.a,flyToCart:h.a}},function(t,e,n){"use strict";var r={Phone:function(t){return/^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(t)},Email:function(t){return/^([0-9A-Za-z\-_\.]+)@([0-9a-z]+\.[a-z]{2,3}(\.[a-z]{2})?)$/g.test(t)},IdCard:function(t){return/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(t)},Common:function(t){return/^[a-zA-Z0-9_]+$/.test(t)},QQ:function(t){return/^[1-9][0-9]{4,10}$/gim.test(t)},Money:function(t){return/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(t)},imgUrl:function(t){return/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*?)\s*$/i.test(t)},verChinese:function(t){return/[\u4e00-\u9fa5]/.test(t)}};e.a=r},function(t,e,n){"use strict";function r(t){return t<10?"0"+t:t}var o={toDate:function(t,e){var n="";n=10==String(t).length?new Date(1e3*t):new Date(t);var o=n.getFullYear(),i=n.getMonth()+1,a=n.getDate(),u=n.getHours(),c=n.getMinutes(),s=n.getSeconds();return"yyyy-MM-dd"==e?o+"-"+r(i)+"-"+r(a):"yyyy-MM-dd HH:mm"==e?o+"-"+r(i)+"-"+r(a)+" "+r(u)+":"+r(c):o+"-"+r(i)+"-"+r(a)+" "+r(u)+":"+r(c)+":"+r(s)},toStamp:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=new Date(t.replace(/-/g,"/")).getTime().toString();return 10==e&&(n=n.substr(0,10)),parseInt(n)},getNow:function(){var t=(new Date).getTime();return o.toDate(t)}};e.a=o},function(t,e,n){"use strict";var r={set:function(t,e,n){n=n||{};var r=n.path?";Path="+n.path:"",o="";if(n.domain&&"domain"==n.domain){o=";domain="+window.location.hostname.split(".").slice(-2).join(".")}var i="";if(n.expires){i=";expires="+(10==String(n.expires).length?new Date(1e3*n.expires):new Date(n.expires)).toGMTString()}document.cookie=t+"="+encodeURIComponent(e)+o+r+i},get:function(t){var e="; "+document.cookie,n=e.split("; "+t+"=");return 2===n.length?decodeURIComponent(n.pop().split(";").shift()):null},remove:function(t,e){e=e||{},e.expires=-1,r.set(t,null,e)}};e.a=r},function(t,e,n){"use strict";var r={throole:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=0;return function(){var r=this,o=Date.now();o-n>e&&(t.call(r,arguments),n=o)}},debounce:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=null;return function(){var r=arguments,o=this;clearTimeout(n),n=setTimeout(function(){t.apply(o,r)},e)}}};e.a=r},function(t,e,n){"use strict";function r(t){return Math.floor(100*t)===100*t}var o=function(t){var e=0;try{t=Number(t);var n=t.toString().toUpperCase();if(2===n.split("E").length){var r=!1;2===n.split(".").length&&(n=n.split(".")[1],0!==parseInt(n.split("E")[0])&&(r=!0));var o=n.split("E");r&&(e=o[0].length),e-=parseInt(o[1])}else 2===n.split(".").length&&0!==parseInt(n.split(".")[1])&&(e=n.split(".")[1].length)}catch(t){throw t}finally{return(isNaN(e)||e<0)&&(e=0),e}},i=function(t){t=Number(t);var e=o(t),n=t.toString().toUpperCase();return 2===n.split("E").length?Math.round(t*Math.pow(10,e)):Number(n.replace(".",""))},a=function(t,e,n,o){var i=0;switch(t){case"add":i=e+n;break;case"sub":i=e-n;break;case"div":i=e/n;break;case"mul":i=e*n}return Math.abs(o-i)>1?i:(r(o)||(o=Number(o.toFixed(2))),o)},u={NumFilter:function(t){var e=String(t).indexOf(".")+1,n=String(t).length-e;return n>0&&n>=3&&(t=Math.floor(100*t)/100),t},add:function(t,e){t=this.NumFilter(Number(t)),e=this.NumFilter(Number(e));var n,r,i;try{n=o(t)+1}catch(t){n=0}try{r=o(e)+1}catch(t){r=0}i=Math.pow(10,Math.max(n,r));var u=(this.mul(t,i)+this.mul(e,i))/i;return a("add",t,e,u)},sub:function(t,e){t=this.NumFilter(Number(t)),e=this.NumFilter(Number(e));var n,r,i;try{n=o(t)+1}catch(t){n=0}try{r=o(e)+1}catch(t){r=0}i=Math.pow(10,Math.max(n,r));var u=Number((this.mul(t,i)-this.mul(e,i))/i);return a("sub",t,e,u)},div:function(t,e){t=Number(t),e=Number(e);var n,r,u=0,c=0;try{u=o(t)}catch(t){}try{c=o(e)}catch(t){}n=i(t),r=i(e);var s=this.mul(n/r,Math.pow(10,c-u));return a("div",t,e,s)},mul:function(t,e){t=Number(t),e=Number(e);var n=0,r=t.toString(),u=e.toString();try{n+=o(r)}catch(t){}try{n+=o(u)}catch(t){}var c=i(r)*i(u)/Math.pow(10,n);return a("mul",t,e,c)}};e.a=u},function(t,e,n){"use strict";function r(t,e){var n=document.createElement("input");n.setAttribute("readonly","readonly"),n.setAttribute("value",t),document.body.appendChild(n),document.execCommand("copy")?(n.select(),document.execCommand("copy"),e({code:200,msg:"复制成功"})):e({code:100,msg:"当前浏览器不支持,请更换浏览器后重试"}),document.body.removeChild(n)}e.a=r},function(t,e,n){"use strict";function r(t,e){var n=t||{};for(var i in e)"object"===o(e[i])?(n[i]=e[i].constructor===Array?[]:{},r(n[i],e[i])):n[i]=e[i];return n}e.a=r;var o="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}},function(t,e,n){"use strict";var r=!1,o=null,i="",a=null,u={PhoneCode:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:60,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"后重新获取";if(i=t.target.innerText,a=t,!r){r=!0,t.target.innerText=n-1+"s"+u;var c=n-1;o=setInterval(function(){c--,c<=0?(t.target.innerText=i,e.PhoneCodeClear()):t.target.innerText=c+"s"+u},1e3)}},PhoneCodeClear:function(){r=!1,a&&(a.target.innerText=i),clearInterval(o)},phoneCodeStatus:function(){return r}};e.a=u},function(t,e,n){"use strict";function r(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function o(t){return i.some(function(e){return e===t})}var i=["",void 0,null],a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"--",n=arguments[2];n&&n.length&&(i=[].concat(r(i),r(n)));var a=[];for(var u in t){for(var c={},s=Object.entries(t[u]),l=0;l<s.length;l++){var f=s[l];o(f[1])&&(f[1]=e),c[f[0]]=f[1]}a.push(c)}return a};e.a=a},function(t,e,n){"use strict";var r=function(t,e){return new Date(t,e,0).getDate()};e.a=r},function(t,e,n){"use strict";function r(t){var e=/U\+([0-9A-Fa-f]{4,6})|\[u\+([0-9A-Fa-f]{4,6})\]|\\u\{([0-9A-Fa-f]{4,6})\}/g;return t?t.replace(e,function(t,e,n,r){var a=e||n||r,u=parseInt(a,16);if(isNaN(u)||u<0||u>1114111)return t;try{var c=String.fromCodePoint(u);return o(u)?c:i(c)?c:t}catch(e){return t}}):t}function o(t){return u.some(function(e){var n=a(e,2),r=n[0],o=n[1];return t>=r&&t<=o})}function i(t){return"�"!==t}e.a=r;var a=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=[[8986,8987],[9193,9196],[9200,9200],[9203,9203],[9642,9643],[9654,9654],[9664,9664],[9723,9726],[9728,9732],[9742,9742],[9745,9745],[9748,9749],[9752,9752],[9757,9757],[9760,9760],[9762,9763],[9766,9766],[9770,9770],[9774,9775],[9784,9786],[9792,9792],[9794,9794],[9800,9811],[9823,9824],[9827,9827],[9829,9830],[9832,9832],[9851,9851],[9855,9855],[9874,9879],[9881,9881],[9883,9884],[9888,9889],[9898,9899],[9904,9905],[9917,9918],[9924,9925],[9928,9928],[9934,9935],[9937,9937],[9939,9940],[9961,9962],[9968,9973],[9975,9978],[9981,9981],[9986,9986],[9989,9989],[9992,9997],[9999,9999],[10002,10002],[10004,10004],[10006,10006],[10013,10013],[10017,10017],[10024,10024],[10035,10036],[10052,10052],[10055,10055],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10083,10084],[10133,10135],[10145,10145],[10160,10160],[10175,10175],[10548,10549],[11013,11015],[11035,11036],[11088,11088],[11093,11093],[126980,126980],[127183,127183],[127344,127345],[127358,127359],[127374,127374],[127377,127386],[127462,127487],[127489,127490],[127514,127514],[127535,127535],[127538,127546],[127568,127569],[127744,128511],[128512,128591],[128640,128767],[128768,128895],[128896,129023],[129024,129279],[129280,129535],[129536,129647],[129648,129791],[129792,130047]]},function(t,e,n){"use strict";function r(t,e,n){if(console.log(t,e,n,"//"),!t)return e;var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp("("+r+")","gi");return e.replace(o,'<span class="'+n+'">$1</span>')}e.a=r},function(t,e,n){"use strict";function r(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},o=t.target,i=document.createElement("img");i.style.cssText="position: fixed;\n width: 20px;\n height: 20px;\n border-radius: 50%;\n pointer-events: none;\n transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.8s;\n z-index: 10000;\n opacity: 1;\n transform-origin: center center;",i.setAttribute("src",e),document.body.appendChild(i);var a=o.getBoundingClientRect(),u=a.left+a.width/2,c=a.top+a.height/2,s=n.getBoundingClientRect(),l=s.left+s.width/2,f=s.top+s.height/2,p=(u+l)/2,d=Math.min(c,f)-150;i.style.left=u+"px",i.style.top=c+"px";var m=0,h=performance.now(),v=function t(e){(m=(e-h)/800)>1&&(m=1);var n=(1-m)*(1-m)*u+2*(1-m)*m*p+m*m*l,o=(1-m)*(1-m)*c+2*(1-m)*m*d+m*m*f;i.style.left=n+"px",i.style.top=o+"px",i.style.transform="scale("+(1-.7*m)+")",i.style.opacity=""+(1-m),m<1?requestAnimationFrame(t):(i.remove(),r())};requestAnimationFrame(v)}e.a=r}])});
1
+ !function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define("js_ryl",[],e):"object"==typeof exports?exports.js_ryl=e():t.js_ryl=e()}("undefined"!=typeof self?self:this,function(){return function(t){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}var n={};return e.m=t,e.c=n,e.d=function(t,n,r){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get: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,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="/dist/",e(e.s=0)}([function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(1),o=n(2),i=n(3),a=n(4),u=n(5),c=n(6),s=n(7),l=n(8),f=n(9),p=n(10),d=n(11),m=n(12),h=n(13);e.default={reg:r.a,time:o.a,cookie:i.a,fun:a.a,num:u.a,copy:c.a,deepCopy:s.a,verCode:l.a,filterTable:f.a,getMonthDays:p.a,emoji:d.a,highLight:m.a,flyToCart:h.a}},function(t,e,n){"use strict";var r={Phone:function(t){return/^[1][3,4,5,6,7,8,9][0-9]{9}$/.test(t)},Email:function(t){return/^([0-9A-Za-z\-_\.]+)@([0-9a-z]+\.[a-z]{2,3}(\.[a-z]{2})?)$/g.test(t)},IdCard:function(t){return/(^\d{15}$)|(^\d{18}$)|(^\d{17}(\d|X|x)$)/.test(t)},Common:function(t){return/^[a-zA-Z0-9_]+$/.test(t)},QQ:function(t){return/^[1-9][0-9]{4,10}$/gim.test(t)},Money:function(t){return/(^[1-9]([0-9]+)?(\.[0-9]{1,2})?$)|(^(0){1}$)|(^[0-9]\.[0-9]([0-9])?$)/.test(t)},imgUrl:function(t){return/^\s*data:([a-z]+\/[a-z0-9-+.]+(;[a-z-]+=[a-z0-9-]+)?)?(;base64)?,([a-z0-9!$&',()*+;=\-._~:@\/?%\s]*?)\s*$/i.test(t)},verChinese:function(t){return/[\u4e00-\u9fa5]/.test(t)}};e.a=r},function(t,e,n){"use strict";function r(t){return t<10?"0"+t:t}var o={toDate:function(t,e){var n="";n=10==String(t).length?new Date(1e3*t):new Date(t);var o=n.getFullYear(),i=n.getMonth()+1,a=n.getDate(),u=n.getHours(),c=n.getMinutes(),s=n.getSeconds();return"yyyy-MM-dd"==e?o+"-"+r(i)+"-"+r(a):"yyyy-MM-dd HH:mm"==e?o+"-"+r(i)+"-"+r(a)+" "+r(u)+":"+r(c):o+"-"+r(i)+"-"+r(a)+" "+r(u)+":"+r(c)+":"+r(s)},toStamp:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:new Date,e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:10,n=new Date(t.replace(/-/g,"/")).getTime().toString();return 10==e&&(n=n.substr(0,10)),parseInt(n)},getNow:function(){var t=(new Date).getTime();return o.toDate(t)}};e.a=o},function(t,e,n){"use strict";var r={set:function(t,e,n){n=n||{};var r=n.path?";Path="+n.path:"",o="";if(n.domain&&"domain"==n.domain){o=";domain="+window.location.hostname.split(".").slice(-2).join(".")}var i="";if(n.expires){i=";expires="+(10==String(n.expires).length?new Date(1e3*n.expires):new Date(n.expires)).toGMTString()}document.cookie=t+"="+encodeURIComponent(e)+o+r+i},get:function(t){var e="; "+document.cookie,n=e.split("; "+t+"=");return 2===n.length?decodeURIComponent(n.pop().split(";").shift()):null},remove:function(t,e){e=e||{},e.expires=-1,r.set(t,null,e)}};e.a=r},function(t,e,n){"use strict";var r={throole:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=0;return function(){var r=this,o=Date.now();o-n>e&&(t.call(r,arguments),n=o)}},debounce:function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:500,n=null;return function(){var r=arguments,o=this;clearTimeout(n),n=setTimeout(function(){t.apply(o,r)},e)}}};e.a=r},function(t,e,n){"use strict";function r(t){return Math.floor(100*t)===100*t}var o=function(t){var e=0;try{t=Number(t);var n=t.toString().toUpperCase();if(2===n.split("E").length){var r=!1;2===n.split(".").length&&(n=n.split(".")[1],0!==parseInt(n.split("E")[0])&&(r=!0));var o=n.split("E");r&&(e=o[0].length),e-=parseInt(o[1])}else 2===n.split(".").length&&0!==parseInt(n.split(".")[1])&&(e=n.split(".")[1].length)}catch(t){throw t}finally{return(isNaN(e)||e<0)&&(e=0),e}},i=function(t){t=Number(t);var e=o(t),n=t.toString().toUpperCase();return 2===n.split("E").length?Math.round(t*Math.pow(10,e)):Number(n.replace(".",""))},a=function(t,e,n,o){var i=0;switch(t){case"add":i=e+n;break;case"sub":i=e-n;break;case"div":i=e/n;break;case"mul":i=e*n}return Math.abs(o-i)>1?i:(r(o)||(o=Number(o.toFixed(2))),o)},u={NumFilter:function(t){var e=String(t).indexOf(".")+1,n=String(t).length-e;return n>0&&n>=3&&(t=Math.floor(100*t)/100),t},add:function(t,e){t=this.NumFilter(Number(t)),e=this.NumFilter(Number(e));var n,r,i;try{n=o(t)+1}catch(t){n=0}try{r=o(e)+1}catch(t){r=0}i=Math.pow(10,Math.max(n,r));var u=(this.mul(t,i)+this.mul(e,i))/i;return a("add",t,e,u)},sub:function(t,e){t=this.NumFilter(Number(t)),e=this.NumFilter(Number(e));var n,r,i;try{n=o(t)+1}catch(t){n=0}try{r=o(e)+1}catch(t){r=0}i=Math.pow(10,Math.max(n,r));var u=Number((this.mul(t,i)-this.mul(e,i))/i);return a("sub",t,e,u)},div:function(t,e){t=Number(t),e=Number(e);var n,r,u=0,c=0;try{u=o(t)}catch(t){}try{c=o(e)}catch(t){}n=i(t),r=i(e);var s=this.mul(n/r,Math.pow(10,c-u));return a("div",t,e,s)},mul:function(t,e){t=Number(t),e=Number(e);var n=0,r=t.toString(),u=e.toString();try{n+=o(r)}catch(t){}try{n+=o(u)}catch(t){}var c=i(r)*i(u)/Math.pow(10,n);return a("mul",t,e,c)}};e.a=u},function(t,e,n){"use strict";function r(t,e){var n=document.createElement("input");n.setAttribute("readonly","readonly"),n.setAttribute("value",t),document.body.appendChild(n),document.execCommand("copy")?(n.select(),document.execCommand("copy"),e({code:200,msg:"复制成功"})):e({code:100,msg:"当前浏览器不支持,请更换浏览器后重试"}),document.body.removeChild(n)}e.a=r},function(t,e,n){"use strict";function r(t,e){var n=t||{};for(var i in e)if(e.hasOwnProperty(i)){var a=e[i];null===a||void 0===a?n[i]=a:Array.isArray(a)?(n[i]=[],r(n[i],a)):"object"===(void 0===a?"undefined":o(a))?(n[i]={},r(n[i],a)):n[i]=a}return n}e.a=r;var o="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}},function(t,e,n){"use strict";var r=!1,o=null,i="",a=null,u={PhoneCode:function(t){var e=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:60,u=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"后重新获取";if(i=t.target.innerText,a=t,!r){r=!0,t.target.innerText=n-1+"s"+u;var c=n-1;o=setInterval(function(){c--,c<=0?(t.target.innerText=i,e.PhoneCodeClear()):t.target.innerText=c+"s"+u},1e3)}},PhoneCodeClear:function(){r=!1,a&&(a.target.innerText=i),clearInterval(o)},phoneCodeStatus:function(){return r}};e.a=u},function(t,e,n){"use strict";function r(t){if(Array.isArray(t)){for(var e=0,n=Array(t.length);e<t.length;e++)n[e]=t[e];return n}return Array.from(t)}function o(t){return i.some(function(e){return e===t})}var i=["",void 0,null],a=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"--",n=arguments[2];n&&n.length&&(i=[].concat(r(i),r(n)));var a=[];for(var u in t){for(var c={},s=Object.entries(t[u]),l=0;l<s.length;l++){var f=s[l];o(f[1])&&(f[1]=e),c[f[0]]=f[1]}a.push(c)}return a};e.a=a},function(t,e,n){"use strict";var r=function(t,e){return new Date(t,e,0).getDate()};e.a=r},function(t,e,n){"use strict";function r(t){var e=/U\+([0-9A-Fa-f]{4,6})|\[u\+([0-9A-Fa-f]{4,6})\]|\\u\{([0-9A-Fa-f]{4,6})\}/g;return t?t.replace(e,function(t,e,n,r){var a=e||n||r,u=parseInt(a,16);if(isNaN(u)||u<0||u>1114111)return t;try{var c=String.fromCodePoint(u);return o(u)?c:i(c)?c:t}catch(e){return t}}):t}function o(t){return u.some(function(e){var n=a(e,2),r=n[0],o=n[1];return t>=r&&t<=o})}function i(t){return"�"!==t}e.a=r;var a=function(){function t(t,e){var n=[],r=!0,o=!1,i=void 0;try{for(var a,u=t[Symbol.iterator]();!(r=(a=u.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,i=t}finally{try{!r&&u.return&&u.return()}finally{if(o)throw i}}return n}return function(e,n){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return t(e,n);throw new TypeError("Invalid attempt to destructure non-iterable instance")}}(),u=[[8986,8987],[9193,9196],[9200,9200],[9203,9203],[9642,9643],[9654,9654],[9664,9664],[9723,9726],[9728,9732],[9742,9742],[9745,9745],[9748,9749],[9752,9752],[9757,9757],[9760,9760],[9762,9763],[9766,9766],[9770,9770],[9774,9775],[9784,9786],[9792,9792],[9794,9794],[9800,9811],[9823,9824],[9827,9827],[9829,9830],[9832,9832],[9851,9851],[9855,9855],[9874,9879],[9881,9881],[9883,9884],[9888,9889],[9898,9899],[9904,9905],[9917,9918],[9924,9925],[9928,9928],[9934,9935],[9937,9937],[9939,9940],[9961,9962],[9968,9973],[9975,9978],[9981,9981],[9986,9986],[9989,9989],[9992,9997],[9999,9999],[10002,10002],[10004,10004],[10006,10006],[10013,10013],[10017,10017],[10024,10024],[10035,10036],[10052,10052],[10055,10055],[10060,10060],[10062,10062],[10067,10069],[10071,10071],[10083,10084],[10133,10135],[10145,10145],[10160,10160],[10175,10175],[10548,10549],[11013,11015],[11035,11036],[11088,11088],[11093,11093],[126980,126980],[127183,127183],[127344,127345],[127358,127359],[127374,127374],[127377,127386],[127462,127487],[127489,127490],[127514,127514],[127535,127535],[127538,127546],[127568,127569],[127744,128511],[128512,128591],[128640,128767],[128768,128895],[128896,129023],[129024,129279],[129280,129535],[129536,129647],[129648,129791],[129792,130047]]},function(t,e,n){"use strict";function r(t,e,n){if(console.log(t,e,n,"//"),!t)return e;var r=t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&"),o=new RegExp("("+r+")","gi");return e.replace(o,'<span class="'+n+'">$1</span>')}e.a=r},function(t,e,n){"use strict";function r(t,e,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:function(){},o=t.target,i=document.createElement("img");i.style.cssText="position: fixed;\n width: 20px;\n height: 20px;\n border-radius: 50%;\n pointer-events: none;\n transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.8s;\n z-index: 10000;\n opacity: 1;\n transform-origin: center center;",i.setAttribute("src",e),document.body.appendChild(i);var a=o.getBoundingClientRect(),u=a.left+a.width/2,c=a.top+a.height/2,s=n.getBoundingClientRect(),l=s.left+s.width/2,f=s.top+s.height/2,p=(u+l)/2,d=Math.min(c,f)-150;i.style.left=u+"px",i.style.top=c+"px";var m=0,h=performance.now(),v=function t(e){(m=(e-h)/800)>1&&(m=1);var n=(1-m)*(1-m)*u+2*(1-m)*m*p+m*m*l,o=(1-m)*(1-m)*c+2*(1-m)*m*d+m*m*f;i.style.left=n+"px",i.style.top=o+"px",i.style.transform="scale("+(1-.7*m)+")",i.style.opacity=""+(1-m),m<1?requestAnimationFrame(t):(i.remove(),r())};requestAnimationFrame(v)}e.a=r}])});
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "js_ryl",
3
- "version": "1.0.28",
3
+ "version": "1.0.29",
4
4
  "private": false,
5
5
  "description": "自定义通用js",
6
6
  "author": "renyuliang <785788909@qq.com>",
package/src/App.vue CHANGED
@@ -134,7 +134,10 @@ export default {
134
134
  info: {
135
135
  sex: '男',
136
136
  like: ['电影','游戏']
137
- }
137
+ },
138
+ sld:null,
139
+ lkdg: undefined,
140
+ oskldk: ''
138
141
  }
139
142
  let obj2 = deepCopy({},obj)
140
143
  obj2.age = 18
@@ -1,13 +1,29 @@
1
- // 深拷贝
1
+ // 深拷贝,支持null、undefined、数组、普通对象
2
2
  export default function deepCopy(obj, tar) {
3
- var dest = obj || {}
3
+ var dest = obj || {};
4
4
  for (const key in tar) {
5
- if (typeof tar[key] === 'object') {
6
- dest[key] = (tar[key].constructor === Array) ? []:{}
7
- deepCopy(dest[key],tar[key])
8
- } else {
9
- dest[key] = tar[key]
5
+ if (!tar.hasOwnProperty(key)) continue; // 只拷贝自身属性
6
+
7
+ const val = tar[key];
8
+
9
+ // 处理 null 和 undefined 直接赋值
10
+ if (val === null || val === undefined) {
11
+ dest[key] = val;
12
+ }
13
+ // 处理数组
14
+ else if (Array.isArray(val)) {
15
+ dest[key] = [];
16
+ deepCopy(dest[key], val);
17
+ }
18
+ // 处理普通对象
19
+ else if (typeof val === 'object') {
20
+ dest[key] = {};
21
+ deepCopy(dest[key], val);
22
+ }
23
+ // 其他基本类型直接赋值
24
+ else {
25
+ dest[key] = val;
10
26
  }
11
27
  }
12
- return dest
13
- }
28
+ return dest;
29
+ }