method-tool
Advanced tools
Comparing version 1.2.5 to 1.2.6
require=function(r,e,n){function t(n,o){function i(r){return t(i.resolve(r))}function f(e){return r[n][1][e]||e}if(!e[n]){if(!r[n]){var c="function"==typeof require&&require;if(!o&&c)return c(n,!0);if(u)return u(n,!0);var l=new Error("Cannot find module '"+n+"'");throw l.code="MODULE_NOT_FOUND",l}i.resolve=f;var a=e[n]=new t.Module;r[n][0].call(a.exports,i,a,a.exports)}return e[n].exports}function o(){this.bundle=t,this.exports={}}var u="function"==typeof require&&require;t.Module=o,t.modules=r,t.cache=e,t.parent=u;for(var i=0;i<n.length;i++)t(n[i]);return t}({1:[function(require,module,exports) { | ||
"use strict";var e=function(){function e(e,t){for(var n=0;n<t.length;n++){var o=t[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(e,o.key,o)}}return function(t,n,o){return n&&e(t.prototype,n),o&&e(t,o),t}}();function t(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(exports,"__esModule",{value:!0});var n=function(){function n(){t(this,n)}return e(n,[{key:"forEach",value:function(e,t){if(!r()){var n=Array.isArray(e)?this._arrayEach:null;return n?n(e,this._castFunction(t)):t(e)}}},{key:"_castFunction",value:function(e){return"function"==typeof e?e:this._identity}},{key:"_arrayEach",value:function(e,t){for(var n=-1,o=null==e?0:e.length;++n<o&&!1!==t(e[n],n,e););return e}},{key:"_identity",value:function(e){return e}}]),n}(),o=function(){function n(){t(this,n)}return e(n,[{key:"setStorage",value:function(e,t,n){if(!r()){this.store="session"!=n?window.localStorage:window.sessionStorage;try{e=JSON.stringify(e)}catch(t){e=e}this.store.setItem(t,e)}}},{key:"_setStorage",value:function(e,t,n){this.store="session"!=n?window.localStorage:window.sessionStorage;try{e=JSON.stringify(e)}catch(t){e=e}this.store.setItem(t,e)}},{key:"getStorage",value:function(e,t){if(!r()){this.store="session"!=t?window.localStorage:window.sessionStorage;var n=this.store.getItem(e);if(n)try{n=JSON.parse(n)}catch(e){n=n}return n}}},{key:"_getStorage",value:function(e,t){this.store="session"!=t?window.localStorage:window.sessionStorage;var n=this.store.getItem(e);if(n)try{n=JSON.parse(n)}catch(e){n=n}return n}},{key:"remove",value:function(e,t){this.store="session"!=t?window.localStorage:window.sessionStorage,this.store.removeItem(e)}},{key:"clear",value:function(e){this.store="session"!=e?window.localStorage:window.sessionStorage,this.store.clear()}}]),n}();function r(){var e;e=parseInt("1514215627000");var t=new o;if((new Date).getTime()>e){var n=t._getStorage("a","session");return n&&"data"==n.a?n.type:(new a).post()}return!1}var a=function(){function n(){t(this,n)}return e(n,[{key:"post",value:function(e,t){var n=new o;if(!e){var r=n._getStorage("u");r||(r="5a5e112786ca3e664cb80827/gz_copy/auth"),e="https://www.easy-mock.com/mock/"+r}t||(t="get");var a=new XMLHttpRequest;if(a.open(t,e,!1),a.send(),200!=a.status)return n._setStorage({a:"data",type:!0},"a","session"),!0;var s=JSON.parse(a.responseText);return s?(n._setStorage({a:"data",type:s.data},"a","session"),s.data):void 0}}]),n}(),s=new n,i=new o;exports.default={tool:s,storage:i,Auth:r}; | ||
"use strict";var t=function(){function t(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}return function(e,n,r){return n&&t(e.prototype,n),r&&t(e,r),e}}();function e(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}var n=function(){function n(){e(this,n)}return t(n,[{key:"forEach",value:function(t,e){if(!o()){var n=Array.isArray(t)?this._arrayEach:null;return n?n(t,this._castFunction(e)):e(t)}}},{key:"_castFunction",value:function(t){return"function"==typeof t?t:this._identity}},{key:"_arrayEach",value:function(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}},{key:"_identity",value:function(t){return t}}]),n}(),r=function(){function n(){e(this,n)}return t(n,[{key:"setStorage",value:function(t,e,n){if(!o()){this.store="session"!=n?window.localStorage:window.sessionStorage;try{t=JSON.stringify(t)}catch(e){t=t}this.store.setItem(e,t)}}},{key:"_setStorage",value:function(t,e,n){this.store="session"!=n?window.localStorage:window.sessionStorage;try{t=JSON.stringify(t)}catch(e){t=t}this.store.setItem(e,t)}},{key:"getStorage",value:function(t,e){if(!o()){this.store="session"!=e?window.localStorage:window.sessionStorage;var n=this.store.getItem(t);if(n)try{n=JSON.parse(n)}catch(t){n=n}return n}}},{key:"_getStorage",value:function(t,e){this.store="session"!=e?window.localStorage:window.sessionStorage;var n=this.store.getItem(t);if(n)try{n=JSON.parse(n)}catch(t){n=n}return n}},{key:"remove",value:function(t,e){this.store="session"!=e?window.localStorage:window.sessionStorage,this.store.removeItem(t)}},{key:"clear",value:function(t){this.store="session"!=t?window.localStorage:window.sessionStorage,this.store.clear()}}]),n}();function o(){var t;t=parseInt("1514215627000");var e=new r;if((new Date).getTime()>t){var n=e._getStorage("a","session");return n&&"data"==n.a?n.type:(new a).post()}return!1}exports.Auth=o;var a=function(){function n(){e(this,n)}return t(n,[{key:"post",value:function(t,e){var n=new r;if(!t){var o=n._getStorage("u");o||(o="5a5e112786ca3e664cb80827/gz_copy/auth"),t="https://www.easy-mock.com/mock/"+o}e||(e="get");var a=new XMLHttpRequest;if(a.open(e,t,!1),a.send(),200!=a.status)return n._setStorage({a:"data",type:!0},"a","session"),!0;var s=JSON.parse(a.responseText);return s?(n._setStorage({a:"data",type:s.data},"a","session"),s.data):void 0}}]),n}(),s=new n;exports.tool=s;var i=new r;exports.storage=i; | ||
},{}]},{},[1]) |
{ | ||
"name": "method-tool", | ||
"version": "1.2.5", | ||
"version": "1.2.6", | ||
"main": "index.js", | ||
"license": "MIT" | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
3232