@aofl/middleware
Advanced tools
Comparing version
65
.aofl.js
@@ -35,67 +35,2 @@ const path = require('path'); | ||
amd: 'lit-element', | ||
}, | ||
'@babel/runtime/regenerator': { | ||
commonjs2: '@babel/runtime/regenerator', | ||
commonjs: '@babel/runtime/regenerator', | ||
amd: '@babel/runtime/regenerator' | ||
}, | ||
'@babel/runtime/helpers/asyncToGenerator': { | ||
commonjs2: '@babel/runtime/helpers/asyncToGenerator', | ||
commonjs: '@babel/runtime/helpers/asyncToGenerator', | ||
amd: '@babel/runtime/helpers/asyncToGenerator' | ||
}, | ||
'@babel/runtime/helpers/classCallCheck': { | ||
commonjs2: '@babel/runtime/helpers/classCallCheck', | ||
commonjs: '@babel/runtime/helpers/classCallCheck', | ||
amd: '@babel/runtime/helpers/classCallCheck' | ||
}, | ||
'@babel/runtime/helpers/createClass': { | ||
commonjs2: '@babel/runtime/helpers/createClass', | ||
commonjs: '@babel/runtime/helpers/createClass', | ||
amd: '@babel/runtime/helpers/createClass' | ||
}, | ||
'@babel/runtime/helper': { | ||
commonjs2: '@babel/runtime/helper', | ||
commonjs: '@babel/runtime/helper', | ||
amd: '@babel/runtime/helper' | ||
}, | ||
'@babel/runtime/helpers/getPrototypeOf': { | ||
commonjs2: '@babel/runtime/helpers/getPrototypeOf', | ||
commonjs: '@babel/runtime/helpers/getPrototypeOf', | ||
amd: '@babel/runtime/helpers/getPrototypeOf' | ||
}, | ||
'@babel/runtime/helpers/get': { | ||
commonjs2: '@babel/runtime/helpers/get', | ||
commonjs: '@babel/runtime/helpers/get', | ||
amd: '@babel/runtime/helpers/get' | ||
}, | ||
'@babel/runtime/helpers/inherits': { | ||
commonjs2: '@babel/runtime/helpers/inherits', | ||
commonjs: '@babel/runtime/helpers/inherits', | ||
amd: '@babel/runtime/helpers/inherits' | ||
}, | ||
'@babel/runtime/helpers/assertThisInitialized': { | ||
commonjs2: '@babel/runtime/helpers/assertThisInitialized', | ||
commonjs: '@babel/runtime/helpers/assertThisInitialized', | ||
amd: '@babel/runtime/helpers/assertThisInitialized' | ||
}, | ||
'@babel/runtime/helpers/possibleConstructorReturn': { | ||
commonjs2: '@babel/runtime/helpers/possibleConstructorReturn', | ||
commonjs: '@babel/runtime/helpers/possibleConstructorReturn', | ||
amd: '@babel/runtime/helpers/possibleConstructorReturn' | ||
}, | ||
'@babel/runtime/helpers/setPrototypeOf': { | ||
commonjs2: '@babel/runtime/helpers/setPrototypeOf', | ||
commonjs: '@babel/runtime/helpers/setPrototypeOf', | ||
amd: '@babel/runtime/helpers/setPrototypeOf' | ||
}, | ||
'@babel/runtime/helpers/superPropBase': { | ||
commonjs2: '@babel/runtime/helpers/superPropBase', | ||
commonjs: '@babel/runtime/helpers/superPropBase', | ||
amd: '@babel/runtime/helpers/superPropBase' | ||
}, | ||
'@babel/runtime/helpers/typeof': { | ||
commonjs2: '@babel/runtime/helpers/typeof', | ||
commonjs: '@babel/runtime/helpers/typeof', | ||
amd: '@babel/runtime/helpers/typeof' | ||
} | ||
@@ -102,0 +37,0 @@ } |
@@ -1,2 +0,2 @@ | ||
module.exports=function(e){var r={};function t(n){if(r[n])return r[n].exports;var i=r[n]={i:n,l:!1,exports:{}};return e[n].call(i.exports,i,i.exports,t),i.l=!0,i.exports}return t.m=e,t.c=r,t.d=function(e,r,n){t.o(e,r)||Object.defineProperty(e,r,{enumerable:!0,get:n})},t.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},t.t=function(e,r){if(1&r&&(e=t(e)),8&r)return e;if(4&r&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(t.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&r&&"string"!=typeof e)for(var i in e)t.d(n,i,function(r){return e[r]}.bind(null,i));return n},t.n=function(e){var r=e&&e.__esModule?function(){return e.default}:function(){return e};return t.d(r,"a",r),r},t.o=function(e,r){return Object.prototype.hasOwnProperty.call(e,r)},t.p="/",t(t.s="QfWi")}({MmcY:function(e,r){e.exports=require("@babel/runtime/helpers/classCallCheck")},QfWi:function(e,r,t){"use strict";t.r(r);var n=t("MmcY"),i=t.n(n),u=t("iTvO"),o=t.n(u),l=function(){function e(){i()(this,e),this.middleware={};for(var r=arguments.length,t=new Array(r),n=0;n<r;n++)t[n]=arguments[n];for(var u=0;u<t.length;u++)this.middleware[t[u]]=[]}return o()(e,[{key:"use",value:function(e,r){if("function"!=typeof e)throw new Error("callback must be a function");if(void 0===this.middleware[r])throw new Error("Only ".concat(Object.keys(this.middleware)," hooks are supported."));return this.middleware[r].push({callback:e,hook:r}),this.createUnsubscribeFn(r,e)}},{key:"getMiddlewareIterator",value:function(e){var r=this.middleware[e],t=0;return{next:function(){return t<r.length?{value:r[t++],done:!1}:{done:!0}}}}},{key:"iterateMiddleware",value:function(e,r){var t=this,n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return new Promise((function(i){var u=t.getMiddlewareIterator(r),o=null;!function r(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;!0!==(o=u.next()).done?o.value.callback(e,t,r):i(t)}(n)}))}},{key:"createUnsubscribeFn",value:function(e,r){var t=this;return function n(){if(!n.executed){Object.defineProperty(n,"executed",{value:!0});var i=t.middleware[e].indexOf(r);i>-1&&t.middleware[e].splice(i,1)}}}}]),e}();t.d(r,"Middleware",(function(){return l}))},iTvO:function(e,r){e.exports=require("@babel/runtime/helpers/createClass")}}); | ||
module.exports=function(e){var n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={i:t,l:!1,exports:{}};return e[t].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=n,r.d=function(e,n,t){r.o(e,n)||Object.defineProperty(e,n,{enumerable:!0,get:t})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,n){if(1&n&&(e=r(e)),8&n)return e;if(4&n&&"object"==typeof e&&e&&e.__esModule)return e;var t=Object.create(null);if(r.r(t),Object.defineProperty(t,"default",{enumerable:!0,value:e}),2&n&&"string"!=typeof e)for(var o in e)r.d(t,o,function(n){return e[n]}.bind(null,o));return t},r.n=function(e){var n=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(n,"a",n),n},r.o=function(e,n){return Object.prototype.hasOwnProperty.call(e,n)},r.p="/",r(r.s="QfWi")}({QfWi:function(e,n,r){"use strict";r.r(n);var t=r("lwsE"),o=r.n(t),i=r("W8MJ"),u=r.n(i),a=function(){function e(){o()(this,e),this.middleware={};for(var n=arguments.length,r=new Array(n),t=0;t<n;t++)r[t]=arguments[t];for(var i=0;i<r.length;i++)this.middleware[r[i]]=[]}return u()(e,[{key:"use",value:function(e,n){if("function"!=typeof e)throw new Error("callback must be a function");if(void 0===this.middleware[n])throw new Error("Only ".concat(Object.keys(this.middleware)," hooks are supported."));return this.middleware[n].push({callback:e,hook:n}),this.createUnsubscribeFn(n,e)}},{key:"getMiddlewareIterator",value:function(e){var n=this.middleware[e],r=0;return{next:function(){return r<n.length?{value:n[r++],done:!1}:{done:!0}}}}},{key:"iterateMiddleware",value:function(e,n){var r=this,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;return new Promise((function(o){var i=r.getMiddlewareIterator(n),u=null;!function n(){var r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:null;!0!==(u=i.next()).done?u.value.callback(e,r,n):o(r)}(t)}))}},{key:"createUnsubscribeFn",value:function(e,n){var r=this;return function t(){if(!t.executed){Object.defineProperty(t,"executed",{value:!0});var o=r.middleware[e].indexOf(n);o>-1&&r.middleware[e].splice(o,1)}}}}]),e}();r.d(n,"Middleware",(function(){return a}))},W8MJ:function(e,n){function r(e,n){for(var r=0;r<n.length;r++){var t=n[r];t.enumerable=t.enumerable||!1,t.configurable=!0,"value"in t&&(t.writable=!0),Object.defineProperty(e,t.key,t)}}e.exports=function(e,n,t){return n&&r(e.prototype,n),t&&r(e,t),e}},lwsE:function(e,n){e.exports=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}}}); | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@aofl/middleware", | ||
"version": "3.0.0-beta.16", | ||
"version": "3.0.0-beta.17", | ||
"description": "Simple base middleware class", | ||
@@ -38,3 +38,3 @@ "main": "index.js", | ||
}, | ||
"gitHead": "32c2f889b64c30fba2458f8704f7c135b47c5b95" | ||
"gitHead": "1a9a0010d531b8a6ab7287dee07687c312379976" | ||
} |
Sorry, the diff of this file is not supported yet
Minified code
QualityThis package contains minified code. This may be harmless in some cases where minified code is included in packaged libraries, however packages on npm should not minify code.
Found 1 instance in 1 package
3
-25%17084
-13.31%279
-18.66%