phaser4-rex-plugins
Version:
2 lines (1 loc) • 1.55 kB
JavaScript
var e,r;e=void 0,r=function(){var e=function(e,r,n){if(!e||"number"==typeof e)return n;if("string"==typeof r){if(e.hasOwnProperty(r))return e[r];if(-1===r.indexOf("."))return n;r=r.split(".")}for(var t=r,o=e,i=n,f=0;f<t.length;f++){if(r=t[f],!o.hasOwnProperty(r)){i=n;break}o=i=o[r]}return i},r=/^\s*-?(\d*\.?\d+|\d+\.?\d*)(e[-+]?\d+)?\s*$/i,n=/^0x[0-9A-F]+$/i,t=function(e){if("string"!=typeof e)return e;if(""===e)e=null;else if(r.test(e))e=parseFloat(e);else if(n.test(e))e=parseInt(e,16);else switch(e){case"false":e=!1;break;case"true":e=!0;break;case"null":e=null;break;case"undefined":e=void 0}return e},o=function(r,n,t){var f,l,s=e(t,"reverse",!1);if(l=r[0],"[object Array]"===Object.prototype.toString.call(l))if(s)for(u=(a=r.length)-1;u>=0;u--)f=o(r[u],n,t);else for(var u=0,a=r.length;u<a;u++)f=o(r[u],n,t);else f=i(r,n,t);return f},i=function(r,n,o){var i,l=e(o,"argsConvert",void 0),s=e(o,"argsConvertScope",void 0),u=r[0];if(f=function(e,r,n,t){void 0===n&&(n=0),void 0===t&&(t=r.length),e.length=t-n;for(var o=0,i=e.length;o<i;o++)e[o]=r[o+n];return e}(f,r,1),l){!0===l&&(l=t,s=void 0);for(var a=0,d=f.length;a<d;a++)f[a]=s?l.call(s,f[a],r):l(f[a],r)}return"string"==typeof u?null==(i=n[u])&&(i=e(n,u,null)):i=u,i.apply(n,f)},f=[];class l extends Phaser.Plugins.BasePlugin{constructor(e){super(e)}run(e,r,n){return o(e,r,n)}}return l},"object"==typeof exports&&"undefined"!=typeof module?module.exports=r():"function"==typeof define&&define.amd?define(r):(e="undefined"!=typeof globalThis?globalThis:e||self).rexruncommandsplugin=r();