frontexpress/frontexpress.min.js

2 lines
14 KiB
JavaScript
Raw Permalink Normal View History

!function(e){function t(n){if(r[n])return r[n].exports;var a=r[n]={exports:{},id:n,loaded:!1};return e[n].call(a.exports,a,a.exports,t),a.loaded=!0,a.exports}var r={};return t.m=e,t.c=r,t.p="",t(0)}([function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}var a=r(8);n(a)},function(e,t){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var n=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),a=function(){function e(){var t=arguments.length<=0||void 0===arguments[0]?"":arguments[0];r(this,e),this.name=t}return n(e,[{key:"entered",value:function(e){}},{key:"exited",value:function(e){}},{key:"updated",value:function(e,t){}},{key:"failed",value:function(e,t){}},{key:"next",value:function(){return!0}}]),e}();t["default"]=a,e.exports=t["default"]},function(e,t){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t["default"]=["GET","HEAD","POST","PUT","DELETE","CONNECT","OPTIONS","TRACE","PATCH"],e.exports=t["default"]},function(e,t,r){"use strict";function n(e){return e&&e.__esModule?e:{"default":e}}function a(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}Object.defineProperty(t,"__esModule",{value:!0});var i=function(){function e(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}return function(t,r,n){return r&&e(t.prototype,r),n&&e(t,n),t}}(),o=r(2),u=n(o),s=r(1),l=n(s),d=function(){function e(t,r,n,i){a(this,e),this.router=t,this.uriPart=r,this.method=n,this.middleware=i,this.visited=!1}return i(e,[{key:"uri",get:function(){if(this.uriPart||this.method)return this.uriPart instanceof RegExp?this.uriPart:this.router.baseUri instanceof RegExp?this.router.baseUri:this.router.baseUri&&this.uriPart?(this.router.baseUri.trim()+this.uriPart.trim()).replace(/\/{2,}/,"/"):this.router.baseUri?this.router.baseUri.trim():this.uriPart}}]),e}(),f=function(){function e(t){a(this,e),t&&(this._baseUri=t),this._routes=[]}return i(e,[{key:"_add",value:function(e){return this._routes.push(e),this}},{key:"routes",value:function(e,t){return this._routes.filter(function(r){if(!r.uri&&!r.method)return!0;if(r.method!==t)return!1;if(!r.uri)return!0;var n=e,a=n.indexOf("?");a>=0&&(n=n.slice(0,a));var i=n.indexOf("#");return i>=0&&(n=n.slice(0,i)),r.uri instanceof RegExp?n.match(r.uri):r.uri===n})}},{key:"visited",value:function(){return this._routes.filter(function(e){return e.visited})}},{key:"use",value:function(e){if(!(e instanceof l["default"])&&"function"!=typeof e)throw new TypeError("use method takes at least a middleware");return this._add(new d(this,(void 0),(void 0),e)),this}},{key:"all",value:function(){for(var e=arguments.length,t=Array(e),r=0;r<e;r++)t[r]=arguments[r];if(0===t.length)throw new TypeError("use all method takes at least a middleware");var n=void 0;if(n=1===t.length?t[0]:t[1],!(n instanceof l["default"])&&"function"!=typeof n)throw new TypeError("use all method takes at least a middleware");var a=!0,i=!1,o=void 0;try{for(var s,d=u["default"][Symbol.iterator]();!(a=(s=d.next()).done);a=!0){var f=s.value;this[f.toLowerCase()].apply(this,t)}}catch(c){i=!0,o=c}finally{try{!a&&d["return"]&&d["return"]()}finally{if(i)throw o}}return this}},{key:"baseUri",set:function(e){if(e){if(!this._baseUri)return void(this._baseUri=e);if(this._baseUri instanceof RegExp)throw new TypeError("the router already contains a regexp uri "+this._baseUri.toString()+" It cannot be mixed with "+e.toString());if(e instanceof RegExp)throw new TypeError("the router already contains an uri "+this._baseUri.toString()+" It cannot be mixed with regexp "+e.toString())}},get:function(){return this._baseUri}}]),e}();t["default"]=f;var c=!0,h=!1,v=void 0;try{for(var y,w=function(){var e=y.value,t=e
//# sourceMappingURL=frontexpress.min.js.map