Comparing version 5.0.0 to 5.0.1
@@ -5,2 +5,21 @@ # Changelog | ||
### [5.0.1](https://github.com/nodeshift/opossum/compare/v5.0.0...v5.0.1) (2020-08-21) | ||
### Bug Fixes | ||
* [Snyk] Upgrade documentation from 12.1.4 to 12.2.0 ([#411](https://github.com/nodeshift/opossum/issues/411)) ([4ed0b30](https://github.com/nodeshift/opossum/commit/4ed0b303c8c6de70d39b8bfd828f2ae0c2643265)) | ||
* package.json to reduce vulnerabilities ([#405](https://github.com/nodeshift/opossum/issues/405)) ([186b464](https://github.com/nodeshift/opossum/commit/186b46425c1db454bb1a2aa42712875b9790ee03)) | ||
* upgrade @babel/core from 7.10.4 to 7.10.5 ([#449](https://github.com/nodeshift/opossum/issues/449)) ([a18d669](https://github.com/nodeshift/opossum/commit/a18d669088682be0f5ef645e65792b8499124829)) | ||
* upgrade coveralls from 3.0.3 to 3.0.9 ([#408](https://github.com/nodeshift/opossum/issues/408)) ([d3bf2b4](https://github.com/nodeshift/opossum/commit/d3bf2b4168841b7335c31c5797ecdd38ece88f19)) | ||
* upgrade documentation from 12.0.0 to 12.1.4 ([#407](https://github.com/nodeshift/opossum/issues/407)) ([f2a2a67](https://github.com/nodeshift/opossum/commit/f2a2a6724592b9e28c25b2a9e3cadb4cc18679b0)) | ||
* upgrade multiple dependencies with Snyk ([#406](https://github.com/nodeshift/opossum/issues/406)) ([c485c2d](https://github.com/nodeshift/opossum/commit/c485c2d596075d94b960ab746f98446e1776db19)) | ||
* upgrade multiple dependencies with Snyk ([#455](https://github.com/nodeshift/opossum/issues/455)) ([1fb7791](https://github.com/nodeshift/opossum/commit/1fb77917be2604f93b9321033916c599b1e4e222)) | ||
* upgrade serve from 11.0.0 to 11.3.0 ([#409](https://github.com/nodeshift/opossum/issues/409)) ([8f35473](https://github.com/nodeshift/opossum/commit/8f3547307eec5a4164e7de3b679316bb08f3f54c)) | ||
* upgrade standard-version from 8.0.1 to 8.0.2 ([#448](https://github.com/nodeshift/opossum/issues/448)) ([dcba522](https://github.com/nodeshift/opossum/commit/dcba5225869c3534b17d33a89ee9b536581b848b)) | ||
* upgrade tape from 4.13.0 to 4.13.2 ([#410](https://github.com/nodeshift/opossum/issues/410)) ([b6bbf55](https://github.com/nodeshift/opossum/commit/b6bbf55382c8804861eacd3b2bc1df45fc4abb2f)) | ||
* upgrade webpack from 4.43.0 to 4.44.0 ([#451](https://github.com/nodeshift/opossum/issues/451)) ([ff127d5](https://github.com/nodeshift/opossum/commit/ff127d55a5fe4213166a9ceee61c8e0c0c9823dd)) | ||
* upgrade webpack from 4.44.0 to 4.44.1 ([#456](https://github.com/nodeshift/opossum/issues/456)) ([544fcd9](https://github.com/nodeshift/opossum/commit/544fcd9ddc34c4401ad71f056e31f2991ad5d63c)) | ||
* **test:** Avoiding an UnhandledPromiseRejection ([196457f](https://github.com/nodeshift/opossum/commit/196457fe1da4c32d2f36b7aee70b2b2a424ff984)) | ||
## [5.0.0](https://github.com/nodeshift/opossum/compare/v4.2.4...v5.0.0) (2020-02-20) | ||
@@ -7,0 +26,0 @@ |
@@ -1,2 +0,2 @@ | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.circuitBreaker=t():e.circuitBreaker=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){(function(t){var r,o=n(2),i=n(9),u=n(11),s=Array.prototype.slice,c={};r=void 0!==t&&t.console?t.console:"undefined"!=typeof window&&window.console?window.console:{};for(var a=[[function(){},"log"],[function(){r.log.apply(r,arguments)},"info"],[function(){r.log.apply(r,arguments)},"warn"],[function(){r.warn.apply(r,arguments)},"error"],[function(e){c[e]=u()},"time"],[function(e){var t=c[e];if(!t)throw new Error("No such label: "+e);var n=u()-t;r.log(e+": "+n+"ms")},"timeEnd"],[function(){var e=new Error;e.name="Trace",e.message=o.format.apply(null,arguments),r.error(e.stack)},"trace"],[function(e){r.log(o.inspect(e)+"\n")},"dir"],[function(e){if(!e){var t=s.call(arguments,1);i.ok(!1,o.format.apply(null,t))}},"assert"]],f=0;f<a.length;f++){var l=a[f],p=l[0],h=l[1];r[h]||(r[h]=p)}e.exports=r}).call(this,n(1))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){(function(e,r){var o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},i=/%[sdj%]/g;t.format=function(e){if(!d(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(c(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,o=r.length,u=String(e).replace(i,(function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),s=r[n];n<o;s=r[++n])v(s)||!O(s)?u+=" "+s:u+=" "+c(s);return u},t.deprecate=function(n,o){if(void 0!==e&&!0===e.noDeprecation)return n;if(void 0===e)return function(){return t.deprecate(n,o).apply(this,arguments)};var i=!1;return function(){if(!i){if(e.throwDeprecation)throw new Error(o);e.traceDeprecation?r.trace(o):r.error(o),i=!0}return n.apply(this,arguments)}};var u,s={};function c(e,n){var r={seen:[],stylize:f};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(n)?r.showHidden=n:n&&t._extend(r,n),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=a),l(r,e,r.depth)}function a(e,t){var n=c.styles[t];return n?"["+c.colors[n][0]+"m"+e+"["+c.colors[n][1]+"m":e}function f(e,t){return e}function l(e,n,r){if(e.customInspect&&n&&x(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,e);return d(o)||(o=l(e,o,r)),o}var i=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(d(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(g(t))return e.stylize(""+t,"number");if(m(t))return e.stylize(""+t,"boolean");if(v(t))return e.stylize("null","null")}(e,n);if(i)return i;var u=Object.keys(n),s=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(u);if(e.showHidden&&(u=Object.getOwnPropertyNames(n)),j(n)&&(u.indexOf("message")>=0||u.indexOf("description")>=0))return p(n);if(0===u.length){if(x(n)){var c=n.name?": "+n.name:"";return e.stylize("[Function"+c+"]","special")}if(w(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(E(n))return e.stylize(Date.prototype.toString.call(n),"date");if(j(n))return p(n)}var a,f="",O=!1,T=["{","}"];(y(n)&&(O=!0,T=["[","]"]),x(n))&&(f=" [Function"+(n.name?": "+n.name:"")+"]");return w(n)&&(f=" "+RegExp.prototype.toString.call(n)),E(n)&&(f=" "+Date.prototype.toUTCString.call(n)),j(n)&&(f=" "+p(n)),0!==u.length||O&&0!=n.length?r<0?w(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),a=O?function(e,t,n,r,o){for(var i=[],u=0,s=t.length;u<s;++u)_(t,String(u))?i.push(h(e,t,n,r,String(u),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(h(e,t,n,r,o,!0))})),i}(e,n,r,s,u):u.map((function(t){return h(e,n,r,s,t,O)})),e.seen.pop(),function(e,t,n){if(e.reduce((function(e,t){return 0,t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(a,f,T)):T[0]+f+T[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,n,r,o,i){var u,s,c;if((c=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?s=c.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):c.set&&(s=e.stylize("[Setter]","special")),_(r,o)||(u="["+o+"]"),s||(e.seen.indexOf(c.value)<0?(s=v(n)?l(e,c.value,null):l(e,c.value,n-1)).indexOf("\n")>-1&&(s=i?s.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+s.split("\n").map((function(e){return" "+e})).join("\n")):s=e.stylize("[Circular]","special")),b(u)){if(i&&o.match(/^\d+$/))return s;(u=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(u=u.substr(1,u.length-2),u=e.stylize(u,"name")):(u=u.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),u=e.stylize(u,"string"))}return u+": "+s}function y(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function v(e){return null===e}function g(e){return"number"==typeof e}function d(e){return"string"==typeof e}function b(e){return void 0===e}function w(e){return O(e)&&"[object RegExp]"===T(e)}function O(e){return"object"==typeof e&&null!==e}function E(e){return O(e)&&"[object Date]"===T(e)}function j(e){return O(e)&&("[object Error]"===T(e)||e instanceof Error)}function x(e){return"function"==typeof e}function T(e){return Object.prototype.toString.call(e)}function S(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(n){if(b(u)&&(u=Object({WEB:"web"}).NODE_DEBUG||""),n=n.toUpperCase(),!s[n])if(new RegExp("\\b"+n+"\\b","i").test(u)){var o=e.pid;s[n]=function(){var e=t.format.apply(t,arguments);r.error("%s %d: %s",n,o,e)}}else s[n]=function(){};return s[n]},t.inspect=c,c.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},c.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=y,t.isBoolean=m,t.isNull=v,t.isNullOrUndefined=function(e){return null==e},t.isNumber=g,t.isString=d,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=b,t.isRegExp=w,t.isObject=O,t.isDate=E,t.isError=j,t.isFunction=x,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(7);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(){var e=new Date,t=[S(e.getHours()),S(e.getMinutes()),S(e.getSeconds())].join(":");return[e.getDate(),k[e.getMonth()],t].join(" ")}function _(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){r.log("%s - %s",P(),t.format.apply(t,arguments))},t.inherits=n(8),t._extend=function(e,t){if(!t||!O(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var L="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function A(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(L&&e[L]){var t;if("function"!=typeof(t=e[L]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,L,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise((function(e,r){t=e,n=r})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(e,r){e?n(e):t(r)}));try{e.apply(this,o)}catch(e){n(e)}return r}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),L&&Object.defineProperty(t,L,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,o(e))},t.promisify.custom=L,t.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function n(){for(var n=[],r=0;r<arguments.length;r++)n.push(arguments[r]);var o=n.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,u=function(){return o.apply(i,arguments)};t.apply(this,n).then((function(t){e.nextTick(u,null,t)}),(function(t){e.nextTick(A,t,u)}))}return Object.setPrototypeOf(n,Object.getPrototypeOf(t)),Object.defineProperties(n,o(t)),n}}).call(this,n(6),n(0))},function(e,t,n){"use strict";(function(t){var n,r="object"==typeof Reflect?Reflect:null,o=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function u(){u.init.call(this)}e.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var s=10;function c(e){return void 0===e._maxListeners?u.defaultMaxListeners:e._maxListeners}function a(e,n,r,o){var i,u,s,a;if("function"!=typeof r)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof r);if(void 0===(u=e._events)?(u=e._events=Object.create(null),e._eventsCount=0):(void 0!==u.newListener&&(e.emit("newListener",n,r.listener?r.listener:r),u=e._events),s=u[n]),void 0===s)s=u[n]=r,++e._eventsCount;else if("function"==typeof s?s=u[n]=o?[r,s]:[s,r]:o?s.unshift(r):s.push(r),(i=c(e))>0&&s.length>i&&!s.warned){s.warned=!0;var f=new Error("Possible EventEmitter memory leak detected. "+s.length+" "+String(n)+" listeners added. Use emitter.setMaxListeners() to increase limit");f.name="MaxListenersExceededWarning",f.emitter=e,f.type=n,f.count=s.length,a=f,t&&t.warn&&t.warn(a)}return e}function f(){for(var e=[],t=0;t<arguments.length;t++)e.push(arguments[t]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,o(this.listener,this.target,e))}function l(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=f.bind(r);return o.listener=n,r.wrapFn=o,o}function p(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):y(o,o.length)}function h(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function y(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return s},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");s=e}}),u.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},u.prototype.getMaxListeners=function(){return c(this)},u.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var u;if(t.length>0&&(u=t[0]),u instanceof Error)throw u;var s=new Error("Unhandled error."+(u?" ("+u.message+")":""));throw s.context=u,s}var c=i[e];if(void 0===c)return!1;if("function"==typeof c)o(c,this,t);else{var a=c.length,f=y(c,a);for(n=0;n<a;++n)o(f[n],this,t)}return!0},u.prototype.addListener=function(e,t){return a(this,e,t,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(e,t){return a(this,e,t,!0)},u.prototype.once=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.on(e,l(this,e,t)),this},u.prototype.prependOnceListener=function(e,t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);return this.prependListener(e,l(this,e,t)),this},u.prototype.removeListener=function(e,t){var n,r,o,i,u;if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t);if(void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){u=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,u||t)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},u.prototype.listeners=function(e){return p(this,e,!0)},u.prototype.rawListeners=function(e){return p(this,e,!1)},u.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):h.call(e,t)},u.prototype.listenerCount=h,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}}).call(this,n(0))},function(e,t,n){"use strict";e.exports=n(5)},function(e,t,n){"use strict";(function(t){function r(e){return function(e){if(Array.isArray(e)){for(var t=0,n=new Array(e.length);t<e.length;t++)n[t]=e[t];return n}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function o(e){return(o="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function i(e){return(i=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function u(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function s(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function c(e,t,n){return t&&s(e.prototype,t),n&&s(e,n),e}function a(e,t){return(a=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var f=n(3),l=n(12),p=n(13),h=Symbol("state"),y=Symbol("open"),m=Symbol("closed"),v=Symbol("half-open"),g=Symbol("pending-close"),d=Symbol("shutdown"),b=Symbol("fallback"),w=Symbol("status"),O=Symbol("name"),E=Symbol("group"),j=new WeakMap,x=Symbol("Enabled"),T=Symbol("warming-up"),S=Symbol("volume-threshold"),k=Symbol("our-error"),P=Symbol("reset-timeout"),_=Symbol("warmup-timeout"),L="options.maxFailures is deprecated. Please use options.errorThresholdPercentage",A=function(e){function n(e){var r,s,c,a=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,n),s=this,c=i(n).call(this),(r=!c||"object"!==o(c)&&"function"!=typeof c?u(s):c).options=a,r.options.timeout=!1!==a.timeout&&(a.timeout||1e4),r.options.resetTimeout=a.resetTimeout||3e4,r.options.errorThresholdPercentage=a.errorThresholdPercentage||50,r.options.rollingCountTimeout=a.rollingCountTimeout||1e4,r.options.rollingCountBuckets=a.rollingCountBuckets||10,r.options.rollingPercentilesEnabled=!1!==a.rollingPercentilesEnabled,r.options.capacity=Number.isInteger(a.capacity)?a.capacity:Number.MAX_SAFE_INTEGER,r.options.errorFilter=a.errorFilter||function(e){return!1},r.semaphore=new p(r.options.capacity),r[S]=Number.isInteger(a.volumeThreshold)?a.volumeThreshold:0,r[T]=!0===a.allowWarmUp,r[w]=new l(r.options),r[h]=m,r[b]=null,r[g]=!1,r[O]=a.name||e.name||F(),r[E]=a.group||r[O],r[x]=!1!==a.enabled,r[T]){var f=r[_]=setTimeout((function(e){return r[T]=!1}),r.options.rollingCountTimeout);"function"==typeof f.unref&&f.unref()}r.action="function"!=typeof e?function(t){return Promise.resolve(e)}:e,a.maxFailures&&t.error(L);var y,d=function(e){return function(t,n){return r[w].increment(e,n)}};return r.on("success",d("successes")),r.on("failure",d("failures")),r.on("fallback",d("fallbacks")),r.on("timeout",d("timeouts")),r.on("fire",d("fires")),r.on("reject",d("rejects")),r.on("cacheHit",d("cacheHits")),r.on("cacheMiss",d("cacheMisses")),r.on("open",(function(e){return r[w].open()})),r.on("close",(function(e){return r[w].close()})),r.on("semaphoreLocked",d("semaphoreRejections")),r.on("open",(y=u(r),function(e){var t=y[P]=setTimeout((function(){y[h]=v,y[g]=!0,y.emit("halfOpen",y.options.resetTimeout)}),y.options.resetTimeout);"function"==typeof t.unref&&t.unref()})),r.on("success",(function(e){r.halfOpen&&r.close()})),r.options.cache&&j.set(u(r),void 0),r}return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&a(e,t)}(n,e),c(n,null,[{key:"isOurError",value:function(e){return!!e[k]}}]),c(n,[{key:"close",value:function(){this[h]!==m&&(this[P]&&clearTimeout(this[P]),this[h]=m,this[g]=!1,this.emit("close"))}},{key:"open",value:function(){this[h]!==y&&(this[h]=y,this[g]=!1,this.emit("open"))}},{key:"shutdown",value:function(){this.disable(),this.removeAllListeners(),this[P]&&clearTimeout(this[P]),this[_]&&clearTimeout(this[_]),this.status.shutdown(),this[h]=d,this.emit("shutdown")}},{key:"fallback",value:function(e){var t=e;return e instanceof n&&(t=function(){return e.fire.apply(e,arguments)}),this[b]=t,this}},{key:"fire",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.call.apply(this,[this.action].concat(t))}},{key:"call",value:function(e){var t=this;if(this.isShutdown){var n=M("The circuit has been shutdown.","ESHUTDOWN");return Promise.reject(n)}for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];var u,s=Array.prototype.slice.call(o);if(this.emit("fire",s),void 0!==j.get(this))return this.emit("cacheHit"),j.get(this);if(this.options.cache&&this.emit("cacheMiss"),!this[x]){var c=this.action.apply(e,s);return"function"==typeof c.then?c:Promise.resolve(c)}if(!this.closed&&!this.pendingClose){var a=M("Breaker is open","EOPENBREAKER");return this.emit("reject",a),D(this,a,s)||Promise.reject(a)}this[g]=!1;var f=!1;return new Promise((function(n,r){var o=Date.now();if(t.semaphore.test()){t.options.timeout&&(u=setTimeout((function(){f=!0;var e=M("Timed out after ".concat(t.options.timeout,"ms"),"ETIMEDOUT"),i=Date.now()-o;t.semaphore.release(),t.emit("timeout",e,i,s),C(e,t,u,s,i,n,r)}),t.options.timeout));try{var i=t.action.apply(e,s),c="function"==typeof i.then?i:Promise.resolve(i);c.then((function(e){f||(clearTimeout(u),t.emit("success",e,Date.now()-o),t.semaphore.release(),n(e),t.options.cache&&j.set(t,c))})).catch((function(e){if(!f){t.semaphore.release();var i=Date.now()-o;C(e,t,u,s,i,n,r)}}))}catch(e){t.semaphore.release();var a=Date.now()-o;C(e,t,u,s,a,n,r)}}else{var l=Date.now()-o,p=M("Semaphore locked","ESEMLOCKED");t.emit("semaphoreLocked",p,l),C(p,t,u,s,l,n,r)}}))}},{key:"clearCache",value:function(){j.set(this,void 0)}},{key:"healthCheck",value:function(e,t){var n=this;if(t=t||5e3,"function"!=typeof e)throw new TypeError("Health check function must be a function");if(isNaN(t))throw new TypeError("Health check interval must be a number");var r=function(t){e.apply(n).catch((function(e){n.emit("healthCheckFailed",e),n.open()}))},o=setInterval(r,t);"function"==typeof o.unref&&o.unref(),r()}},{key:"enable",value:function(){this[x]=!0}},{key:"disable",value:function(){this[x]=!1}},{key:"isShutdown",get:function(){return this[h]===d}},{key:"name",get:function(){return this[O]}},{key:"group",get:function(){return this[E]}},{key:"pendingClose",get:function(){return this[g]}},{key:"closed",get:function(){return this[h]===m}},{key:"opened",get:function(){return this[h]===y}},{key:"halfOpen",get:function(){return this[h]===v}},{key:"status",get:function(){return this[w]}},{key:"stats",get:function(){return this[w].stats}},{key:"enabled",get:function(){return this[x]}},{key:"warmUp",get:function(){return this[T]}},{key:"volumeThreshold",get:function(){return this[S]}}]),n}(f);function C(e,t,n,r,o,i,u){clearTimeout(n),t.options.errorFilter(e)?t.emit("success",e,o):function(e,t,n,r){if(e.emit("failure",t,r,n),e.warmUp)return;var o=e.stats;if(o.fires<e.volumeThreshold&&!e.halfOpen)return;(o.failures/o.fires*100>e.options.errorThresholdPercentage||o.failures>=e.options.maxFailures||e.halfOpen)&&e.open()}(t,e,r,o);var s=D(t,e,r);s?i(s):u(e)}function D(e,t,n){if(e[b]){var o=e[b].apply(e[b],[].concat(r(n),[t]));return e.emit("fallback",o,t),o instanceof Promise?o:Promise.resolve(o)}}function M(e,t){var n=new Error(e);return n.code=t,n[k]=!0,n}var F=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))};e.exports=A}).call(this,n(0))},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function s(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(e){r=u}}();var c,a=[],f=!1,l=-1;function p(){f&&c&&(f=!1,c.length?a=c.concat(a):l=-1,a.length&&h())}function h(){if(!f){var e=s(p);f=!0;for(var t=a.length;t;){for(c=a,a=[];++l<t;)c&&c[l].run();l=-1,t=a.length}c=null,f=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function y(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];a.push(new y(e,t)),1!==a.length||f||s(h)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){"use strict";(function(t){var r=n(10); | ||
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.circuitBreaker=t():e.circuitBreaker=t()}(window,(function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:r})},n.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},n.t=function(e,t){if(1&t&&(e=n(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var r=Object.create(null);if(n.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)n.d(r,o,function(t){return e[t]}.bind(null,o));return r},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=4)}([function(e,t,n){(function(t){var r=n(2),o=n(9);function i(){return(new Date).getTime()}var u,c=Array.prototype.slice,s={};u=void 0!==t&&t.console?t.console:"undefined"!=typeof window&&window.console?window.console:{};for(var a=[[function(){},"log"],[function(){u.log.apply(u,arguments)},"info"],[function(){u.log.apply(u,arguments)},"warn"],[function(){u.warn.apply(u,arguments)},"error"],[function(e){s[e]=i()},"time"],[function(e){var t=s[e];if(!t)throw new Error("No such label: "+e);delete s[e];var n=i()-t;u.log(e+": "+n+"ms")},"timeEnd"],[function(){var e=new Error;e.name="Trace",e.message=r.format.apply(null,arguments),u.error(e.stack)},"trace"],[function(e){u.log(r.inspect(e)+"\n")},"dir"],[function(e){if(!e){var t=c.call(arguments,1);o.ok(!1,r.format.apply(null,t))}},"assert"]],f=0;f<a.length;f++){var l=a[f],p=l[0],h=l[1];u[h]||(u[h]=p)}e.exports=u}).call(this,n(1))},function(e,t){var n;n=function(){return this}();try{n=n||new Function("return this")()}catch(e){"object"==typeof window&&(n=window)}e.exports=n},function(e,t,n){(function(e,r){var o=Object.getOwnPropertyDescriptors||function(e){for(var t=Object.keys(e),n={},r=0;r<t.length;r++)n[t[r]]=Object.getOwnPropertyDescriptor(e,t[r]);return n},i=/%[sdj%]/g;t.format=function(e){if(!g(e)){for(var t=[],n=0;n<arguments.length;n++)t.push(s(arguments[n]));return t.join(" ")}n=1;for(var r=arguments,o=r.length,u=String(e).replace(i,(function(e){if("%%"===e)return"%";if(n>=o)return e;switch(e){case"%s":return String(r[n++]);case"%d":return Number(r[n++]);case"%j":try{return JSON.stringify(r[n++])}catch(e){return"[Circular]"}default:return e}})),c=r[n];n<o;c=r[++n])v(c)||!O(c)?u+=" "+c:u+=" "+s(c);return u},t.deprecate=function(n,o){if(void 0!==e&&!0===e.noDeprecation)return n;if(void 0===e)return function(){return t.deprecate(n,o).apply(this,arguments)};var i=!1;return function(){if(!i){if(e.throwDeprecation)throw new Error(o);e.traceDeprecation?r.trace(o):r.error(o),i=!0}return n.apply(this,arguments)}};var u,c={};function s(e,n){var r={seen:[],stylize:f};return arguments.length>=3&&(r.depth=arguments[2]),arguments.length>=4&&(r.colors=arguments[3]),m(n)?r.showHidden=n:n&&t._extend(r,n),b(r.showHidden)&&(r.showHidden=!1),b(r.depth)&&(r.depth=2),b(r.colors)&&(r.colors=!1),b(r.customInspect)&&(r.customInspect=!0),r.colors&&(r.stylize=a),l(r,e,r.depth)}function a(e,t){var n=s.styles[t];return n?"["+s.colors[n][0]+"m"+e+"["+s.colors[n][1]+"m":e}function f(e,t){return e}function l(e,n,r){if(e.customInspect&&n&&x(n.inspect)&&n.inspect!==t.inspect&&(!n.constructor||n.constructor.prototype!==n)){var o=n.inspect(r,e);return g(o)||(o=l(e,o,r)),o}var i=function(e,t){if(b(t))return e.stylize("undefined","undefined");if(g(t)){var n="'"+JSON.stringify(t).replace(/^"|"$/g,"").replace(/'/g,"\\'").replace(/\\"/g,'"')+"'";return e.stylize(n,"string")}if(d(t))return e.stylize(""+t,"number");if(m(t))return e.stylize(""+t,"boolean");if(v(t))return e.stylize("null","null")}(e,n);if(i)return i;var u=Object.keys(n),c=function(e){var t={};return e.forEach((function(e,n){t[e]=!0})),t}(u);if(e.showHidden&&(u=Object.getOwnPropertyNames(n)),j(n)&&(u.indexOf("message")>=0||u.indexOf("description")>=0))return p(n);if(0===u.length){if(x(n)){var s=n.name?": "+n.name:"";return e.stylize("[Function"+s+"]","special")}if(w(n))return e.stylize(RegExp.prototype.toString.call(n),"regexp");if(E(n))return e.stylize(Date.prototype.toString.call(n),"date");if(j(n))return p(n)}var a,f="",O=!1,S=["{","}"];(y(n)&&(O=!0,S=["[","]"]),x(n))&&(f=" [Function"+(n.name?": "+n.name:"")+"]");return w(n)&&(f=" "+RegExp.prototype.toString.call(n)),E(n)&&(f=" "+Date.prototype.toUTCString.call(n)),j(n)&&(f=" "+p(n)),0!==u.length||O&&0!=n.length?r<0?w(n)?e.stylize(RegExp.prototype.toString.call(n),"regexp"):e.stylize("[Object]","special"):(e.seen.push(n),a=O?function(e,t,n,r,o){for(var i=[],u=0,c=t.length;u<c;++u)_(t,String(u))?i.push(h(e,t,n,r,String(u),!0)):i.push("");return o.forEach((function(o){o.match(/^\d+$/)||i.push(h(e,t,n,r,o,!0))})),i}(e,n,r,c,u):u.map((function(t){return h(e,n,r,c,t,O)})),e.seen.pop(),function(e,t,n){if(e.reduce((function(e,t){return t.indexOf("\n")>=0&&0,e+t.replace(/\u001b\[\d\d?m/g,"").length+1}),0)>60)return n[0]+(""===t?"":t+"\n ")+" "+e.join(",\n ")+" "+n[1];return n[0]+t+" "+e.join(", ")+" "+n[1]}(a,f,S)):S[0]+f+S[1]}function p(e){return"["+Error.prototype.toString.call(e)+"]"}function h(e,t,n,r,o,i){var u,c,s;if((s=Object.getOwnPropertyDescriptor(t,o)||{value:t[o]}).get?c=s.set?e.stylize("[Getter/Setter]","special"):e.stylize("[Getter]","special"):s.set&&(c=e.stylize("[Setter]","special")),_(r,o)||(u="["+o+"]"),c||(e.seen.indexOf(s.value)<0?(c=v(n)?l(e,s.value,null):l(e,s.value,n-1)).indexOf("\n")>-1&&(c=i?c.split("\n").map((function(e){return" "+e})).join("\n").substr(2):"\n"+c.split("\n").map((function(e){return" "+e})).join("\n")):c=e.stylize("[Circular]","special")),b(u)){if(i&&o.match(/^\d+$/))return c;(u=JSON.stringify(""+o)).match(/^"([a-zA-Z_][a-zA-Z_0-9]*)"$/)?(u=u.substr(1,u.length-2),u=e.stylize(u,"name")):(u=u.replace(/'/g,"\\'").replace(/\\"/g,'"').replace(/(^"|"$)/g,"'"),u=e.stylize(u,"string"))}return u+": "+c}function y(e){return Array.isArray(e)}function m(e){return"boolean"==typeof e}function v(e){return null===e}function d(e){return"number"==typeof e}function g(e){return"string"==typeof e}function b(e){return void 0===e}function w(e){return O(e)&&"[object RegExp]"===S(e)}function O(e){return"object"==typeof e&&null!==e}function E(e){return O(e)&&"[object Date]"===S(e)}function j(e){return O(e)&&("[object Error]"===S(e)||e instanceof Error)}function x(e){return"function"==typeof e}function S(e){return Object.prototype.toString.call(e)}function T(e){return e<10?"0"+e.toString(10):e.toString(10)}t.debuglog=function(n){if(b(u)&&(u=Object({WEB:"web"}).NODE_DEBUG||""),n=n.toUpperCase(),!c[n])if(new RegExp("\\b"+n+"\\b","i").test(u)){var o=e.pid;c[n]=function(){var e=t.format.apply(t,arguments);r.error("%s %d: %s",n,o,e)}}else c[n]=function(){};return c[n]},t.inspect=s,s.colors={bold:[1,22],italic:[3,23],underline:[4,24],inverse:[7,27],white:[37,39],grey:[90,39],black:[30,39],blue:[34,39],cyan:[36,39],green:[32,39],magenta:[35,39],red:[31,39],yellow:[33,39]},s.styles={special:"cyan",number:"yellow",boolean:"yellow",undefined:"grey",null:"bold",string:"green",date:"magenta",regexp:"red"},t.isArray=y,t.isBoolean=m,t.isNull=v,t.isNullOrUndefined=function(e){return null==e},t.isNumber=d,t.isString=g,t.isSymbol=function(e){return"symbol"==typeof e},t.isUndefined=b,t.isRegExp=w,t.isObject=O,t.isDate=E,t.isError=j,t.isFunction=x,t.isPrimitive=function(e){return null===e||"boolean"==typeof e||"number"==typeof e||"string"==typeof e||"symbol"==typeof e||void 0===e},t.isBuffer=n(7);var k=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function P(){var e=new Date,t=[T(e.getHours()),T(e.getMinutes()),T(e.getSeconds())].join(":");return[e.getDate(),k[e.getMonth()],t].join(" ")}function _(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.log=function(){r.log("%s - %s",P(),t.format.apply(t,arguments))},t.inherits=n(8),t._extend=function(e,t){if(!t||!O(t))return e;for(var n=Object.keys(t),r=n.length;r--;)e[n[r]]=t[n[r]];return e};var L="undefined"!=typeof Symbol?Symbol("util.promisify.custom"):void 0;function A(e,t){if(!e){var n=new Error("Promise was rejected with a falsy value");n.reason=e,e=n}return t(e)}t.promisify=function(e){if("function"!=typeof e)throw new TypeError('The "original" argument must be of type Function');if(L&&e[L]){var t;if("function"!=typeof(t=e[L]))throw new TypeError('The "util.promisify.custom" argument must be of type Function');return Object.defineProperty(t,L,{value:t,enumerable:!1,writable:!1,configurable:!0}),t}function t(){for(var t,n,r=new Promise((function(e,r){t=e,n=r})),o=[],i=0;i<arguments.length;i++)o.push(arguments[i]);o.push((function(e,r){e?n(e):t(r)}));try{e.apply(this,o)}catch(e){n(e)}return r}return Object.setPrototypeOf(t,Object.getPrototypeOf(e)),L&&Object.defineProperty(t,L,{value:t,enumerable:!1,writable:!1,configurable:!0}),Object.defineProperties(t,o(e))},t.promisify.custom=L,t.callbackify=function(t){if("function"!=typeof t)throw new TypeError('The "original" argument must be of type Function');function n(){for(var n=[],r=0;r<arguments.length;r++)n.push(arguments[r]);var o=n.pop();if("function"!=typeof o)throw new TypeError("The last argument must be of type Function");var i=this,u=function(){return o.apply(i,arguments)};t.apply(this,n).then((function(t){e.nextTick(u,null,t)}),(function(t){e.nextTick(A,t,u)}))}return Object.setPrototypeOf(n,Object.getPrototypeOf(t)),Object.defineProperties(n,o(t)),n}}).call(this,n(6),n(0))},function(e,t,n){"use strict";(function(t){var n,r="object"==typeof Reflect?Reflect:null,o=r&&"function"==typeof r.apply?r.apply:function(e,t,n){return Function.prototype.apply.call(e,t,n)};n=r&&"function"==typeof r.ownKeys?r.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var i=Number.isNaN||function(e){return e!=e};function u(){u.init.call(this)}e.exports=u,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var c=10;function s(e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function a(e){return void 0===e._maxListeners?u.defaultMaxListeners:e._maxListeners}function f(e,n,r,o){var i,u,c,f;if(s(r),void 0===(u=e._events)?(u=e._events=Object.create(null),e._eventsCount=0):(void 0!==u.newListener&&(e.emit("newListener",n,r.listener?r.listener:r),u=e._events),c=u[n]),void 0===c)c=u[n]=r,++e._eventsCount;else if("function"==typeof c?c=u[n]=o?[r,c]:[c,r]:o?c.unshift(r):c.push(r),(i=a(e))>0&&c.length>i&&!c.warned){c.warned=!0;var l=new Error("Possible EventEmitter memory leak detected. "+c.length+" "+String(n)+" listeners added. Use emitter.setMaxListeners() to increase limit");l.name="MaxListenersExceededWarning",l.emitter=e,l.type=n,l.count=c.length,f=l,t&&t.warn&&t.warn(f)}return e}function l(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function p(e,t,n){var r={fired:!1,wrapFn:void 0,target:e,type:t,listener:n},o=l.bind(r);return o.listener=n,r.wrapFn=o,o}function h(e,t,n){var r=e._events;if(void 0===r)return[];var o=r[t];return void 0===o?[]:"function"==typeof o?n?[o.listener||o]:[o]:n?function(e){for(var t=new Array(e.length),n=0;n<t.length;++n)t[n]=e[n].listener||e[n];return t}(o):m(o,o.length)}function y(e){var t=this._events;if(void 0!==t){var n=t[e];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function m(e,t){for(var n=new Array(t),r=0;r<t;++r)n[r]=e[r];return n}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");c=e}}),u.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(e){if("number"!=typeof e||e<0||i(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},u.prototype.getMaxListeners=function(){return a(this)},u.prototype.emit=function(e){for(var t=[],n=1;n<arguments.length;n++)t.push(arguments[n]);var r="error"===e,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var u;if(t.length>0&&(u=t[0]),u instanceof Error)throw u;var c=new Error("Unhandled error."+(u?" ("+u.message+")":""));throw c.context=u,c}var s=i[e];if(void 0===s)return!1;if("function"==typeof s)o(s,this,t);else{var a=s.length,f=m(s,a);for(n=0;n<a;++n)o(f[n],this,t)}return!0},u.prototype.addListener=function(e,t){return f(this,e,t,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(e,t){return f(this,e,t,!0)},u.prototype.once=function(e,t){return s(t),this.on(e,p(this,e,t)),this},u.prototype.prependOnceListener=function(e,t){return s(t),this.prependListener(e,p(this,e,t)),this},u.prototype.removeListener=function(e,t){var n,r,o,i,u;if(s(t),void 0===(r=this._events))return this;if(void 0===(n=r[e]))return this;if(n===t||n.listener===t)0==--this._eventsCount?this._events=Object.create(null):(delete r[e],r.removeListener&&this.emit("removeListener",e,n.listener||t));else if("function"!=typeof n){for(o=-1,i=n.length-1;i>=0;i--)if(n[i]===t||n[i].listener===t){u=n[i].listener,o=i;break}if(o<0)return this;0===o?n.shift():function(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}(n,o),1===n.length&&(r[e]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",e,u||t)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(e){var t,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[e]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[e]),this;if(0===arguments.length){var o,i=Object.keys(n);for(r=0;r<i.length;++r)"removeListener"!==(o=i[r])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(t=n[e]))this.removeListener(e,t);else if(void 0!==t)for(r=t.length-1;r>=0;r--)this.removeListener(e,t[r]);return this},u.prototype.listeners=function(e){return h(this,e,!0)},u.prototype.rawListeners=function(e){return h(this,e,!1)},u.listenerCount=function(e,t){return"function"==typeof e.listenerCount?e.listenerCount(t):y.call(e,t)},u.prototype.listenerCount=y,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}}).call(this,n(0))},function(e,t,n){"use strict";e.exports=n(5)},function(e,t,n){"use strict";(function(t){function r(e){return function(e){if(Array.isArray(e))return o(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||function(e,t){if(!e)return;if("string"==typeof e)return o(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);"Object"===n&&e.constructor&&(n=e.constructor.name);if("Map"===n||"Set"===n)return Array.from(n);if("Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n))return o(e,t)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function o(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function i(e){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function u(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function c(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function s(e,t,n){return t&&c(e.prototype,t),n&&c(e,n),e}function a(e,t){return!t||"object"!==i(t)&&"function"!=typeof t?f(e):t}function f(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function l(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function p(e){return(p=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function h(e,t){return(h=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var y=n(3),m=n(11),v=n(12),d=Symbol("state"),g=Symbol("open"),b=Symbol("closed"),w=Symbol("half-open"),O=Symbol("pending-close"),E=Symbol("shutdown"),j=Symbol("fallback"),x=Symbol("status"),S=Symbol("name"),T=Symbol("group"),k=new WeakMap,P=Symbol("Enabled"),_=Symbol("warming-up"),L=Symbol("volume-threshold"),A=Symbol("our-error"),D=Symbol("reset-timeout"),C=Symbol("warmup-timeout"),M="options.maxFailures is deprecated. Please use options.errorThresholdPercentage",R=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&h(e,t)}(o,e);var n,r=(n=o,function(){var e,t=p(n);if(l()){var r=p(this).constructor;e=Reflect.construct(t,arguments,r)}else e=t.apply(this,arguments);return a(this,e)});function o(e){var n,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};if(u(this,o),(n=r.call(this)).options=i,n.options.timeout=!1!==i.timeout&&(i.timeout||1e4),n.options.resetTimeout=i.resetTimeout||3e4,n.options.errorThresholdPercentage=i.errorThresholdPercentage||50,n.options.rollingCountTimeout=i.rollingCountTimeout||1e4,n.options.rollingCountBuckets=i.rollingCountBuckets||10,n.options.rollingPercentilesEnabled=!1!==i.rollingPercentilesEnabled,n.options.capacity=Number.isInteger(i.capacity)?i.capacity:Number.MAX_SAFE_INTEGER,n.options.errorFilter=i.errorFilter||function(e){return!1},n.semaphore=new v(n.options.capacity),n[L]=Number.isInteger(i.volumeThreshold)?i.volumeThreshold:0,n[_]=!0===i.allowWarmUp,n[x]=new m(n.options),n[d]=b,n[j]=null,n[O]=!1,n[S]=i.name||e.name||B(),n[T]=i.group||n[S],n[P]=!1!==i.enabled,n[_]){var c=n[C]=setTimeout((function(e){return n[_]=!1}),n.options.rollingCountTimeout);"function"==typeof c.unref&&c.unref()}n.action="function"!=typeof e?function(t){return Promise.resolve(e)}:e,i.maxFailures&&t.error(M);var s=function(e){return function(t,r){return n[x].increment(e,r)}};function a(e){return function(t){var n=e[D]=setTimeout((function(){e[d]=w,e[O]=!0,e.emit("halfOpen",e.options.resetTimeout)}),e.options.resetTimeout);"function"==typeof n.unref&&n.unref()}}return n.on("success",s("successes")),n.on("failure",s("failures")),n.on("fallback",s("fallbacks")),n.on("timeout",s("timeouts")),n.on("fire",s("fires")),n.on("reject",s("rejects")),n.on("cacheHit",s("cacheHits")),n.on("cacheMiss",s("cacheMisses")),n.on("open",(function(e){return n[x].open()})),n.on("close",(function(e){return n[x].close()})),n.on("semaphoreLocked",s("semaphoreRejections")),n.on("open",a(f(n))),n.on("success",(function(e){n.halfOpen&&n.close()})),n.options.cache&&k.set(f(n),void 0),n}return s(o,null,[{key:"isOurError",value:function(e){return!!e[A]}}]),s(o,[{key:"close",value:function(){this[d]!==b&&(this[D]&&clearTimeout(this[D]),this[d]=b,this[O]=!1,this.emit("close"))}},{key:"open",value:function(){this[d]!==g&&(this[d]=g,this[O]=!1,this.emit("open"))}},{key:"shutdown",value:function(){this.disable(),this.removeAllListeners(),this[D]&&clearTimeout(this[D]),this[C]&&clearTimeout(this[C]),this.status.shutdown(),this[d]=E,this.emit("shutdown")}},{key:"fallback",value:function(e){var t=e;return e instanceof o&&(t=function(){return e.fire.apply(e,arguments)}),this[j]=t,this}},{key:"fire",value:function(){for(var e=arguments.length,t=new Array(e),n=0;n<e;n++)t[n]=arguments[n];return this.call.apply(this,[this.action].concat(t))}},{key:"call",value:function(e){var t=this;if(this.isShutdown){var n=N("The circuit has been shutdown.","ESHUTDOWN");return Promise.reject(n)}for(var r=arguments.length,o=new Array(r>1?r-1:0),i=1;i<r;i++)o[i-1]=arguments[i];var u,c=Array.prototype.slice.call(o);if(this.emit("fire",c),void 0!==k.get(this))return this.emit("cacheHit"),k.get(this);if(this.options.cache&&this.emit("cacheMiss"),!this[P]){var s=this.action.apply(e,c);return"function"==typeof s.then?s:Promise.resolve(s)}if(!this.closed&&!this.pendingClose){var a=N("Breaker is open","EOPENBREAKER");return this.emit("reject",a),F(this,a,c)||Promise.reject(a)}this[O]=!1;var f=!1;return new Promise((function(n,r){var o=Date.now();if(t.semaphore.test()){t.options.timeout&&(u=setTimeout((function(){f=!0;var e=N("Timed out after ".concat(t.options.timeout,"ms"),"ETIMEDOUT"),i=Date.now()-o;t.semaphore.release(),t.emit("timeout",e,i,c),q(e,t,u,c,i,n,r)}),t.options.timeout));try{var i=t.action.apply(e,c),s="function"==typeof i.then?i:Promise.resolve(i);s.then((function(e){f||(clearTimeout(u),t.emit("success",e,Date.now()-o),t.semaphore.release(),n(e),t.options.cache&&k.set(t,s))})).catch((function(e){if(!f){t.semaphore.release();var i=Date.now()-o;q(e,t,u,c,i,n,r)}}))}catch(e){t.semaphore.release();var a=Date.now()-o;q(e,t,u,c,a,n,r)}}else{var l=Date.now()-o,p=N("Semaphore locked","ESEMLOCKED");t.emit("semaphoreLocked",p,l),q(p,t,u,c,l,n,r)}}))}},{key:"clearCache",value:function(){k.set(this,void 0)}},{key:"healthCheck",value:function(e,t){var n=this;if(t=t||5e3,"function"!=typeof e)throw new TypeError("Health check function must be a function");if(isNaN(t))throw new TypeError("Health check interval must be a number");var r=function(t){e.apply(n).catch((function(e){n.emit("healthCheckFailed",e),n.open()}))},o=setInterval(r,t);"function"==typeof o.unref&&o.unref(),r()}},{key:"enable",value:function(){this[P]=!0}},{key:"disable",value:function(){this[P]=!1}},{key:"isShutdown",get:function(){return this[d]===E}},{key:"name",get:function(){return this[S]}},{key:"group",get:function(){return this[T]}},{key:"pendingClose",get:function(){return this[O]}},{key:"closed",get:function(){return this[d]===b}},{key:"opened",get:function(){return this[d]===g}},{key:"halfOpen",get:function(){return this[d]===w}},{key:"status",get:function(){return this[x]}},{key:"stats",get:function(){return this[x].stats}},{key:"enabled",get:function(){return this[P]}},{key:"warmUp",get:function(){return this[_]}},{key:"volumeThreshold",get:function(){return this[L]}}]),o}(y);function q(e,t,n,r,o,i,u){clearTimeout(n),t.options.errorFilter(e)?t.emit("success",e,o):function(e,t,n,r){if(e.emit("failure",t,r,n),e.warmUp)return;var o=e.stats;if(o.fires<e.volumeThreshold&&!e.halfOpen)return;(o.failures/o.fires*100>e.options.errorThresholdPercentage||o.failures>=e.options.maxFailures||e.halfOpen)&&e.open()}(t,e,r,o);var c=F(t,e,r);c?i(c):u(e)}function F(e,t,n){if(e[j]){var o=e[j].apply(e[j],[].concat(r(n),[t]));return e.emit("fallback",o,t),o instanceof Promise?o:Promise.resolve(o)}}function N(e,t){var n=new Error(e);return n.code=t,n[A]=!0,n}var B=function(){return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,(function(e){var t=16*Math.random()|0;return("x"===e?t:3&t|8).toString(16)}))};e.exports=R}).call(this,n(0))},function(e,t){var n,r,o=e.exports={};function i(){throw new Error("setTimeout has not been defined")}function u(){throw new Error("clearTimeout has not been defined")}function c(e){if(n===setTimeout)return setTimeout(e,0);if((n===i||!n)&&setTimeout)return n=setTimeout,setTimeout(e,0);try{return n(e,0)}catch(t){try{return n.call(null,e,0)}catch(t){return n.call(this,e,0)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:i}catch(e){n=i}try{r="function"==typeof clearTimeout?clearTimeout:u}catch(e){r=u}}();var s,a=[],f=!1,l=-1;function p(){f&&s&&(f=!1,s.length?a=s.concat(a):l=-1,a.length&&h())}function h(){if(!f){var e=c(p);f=!0;for(var t=a.length;t;){for(s=a,a=[];++l<t;)s&&s[l].run();l=-1,t=a.length}s=null,f=!1,function(e){if(r===clearTimeout)return clearTimeout(e);if((r===u||!r)&&clearTimeout)return r=clearTimeout,clearTimeout(e);try{r(e)}catch(t){try{return r.call(null,e)}catch(t){return r.call(this,e)}}}(e)}}function y(e,t){this.fun=e,this.array=t}function m(){}o.nextTick=function(e){var t=new Array(arguments.length-1);if(arguments.length>1)for(var n=1;n<arguments.length;n++)t[n-1]=arguments[n];a.push(new y(e,t)),1!==a.length||f||c(h)},y.prototype.run=function(){this.fun.apply(null,this.array)},o.title="browser",o.browser=!0,o.env={},o.argv=[],o.version="",o.versions={},o.on=m,o.addListener=m,o.once=m,o.off=m,o.removeListener=m,o.removeAllListeners=m,o.emit=m,o.prependListener=m,o.prependOnceListener=m,o.listeners=function(e){return[]},o.binding=function(e){throw new Error("process.binding is not supported")},o.cwd=function(){return"/"},o.chdir=function(e){throw new Error("process.chdir is not supported")},o.umask=function(){return 0}},function(e,t){e.exports=function(e){return e&&"object"==typeof e&&"function"==typeof e.copy&&"function"==typeof e.fill&&"function"==typeof e.readUInt8}},function(e,t){"function"==typeof Object.create?e.exports=function(e,t){e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}})}:e.exports=function(e,t){e.super_=t;var n=function(){};n.prototype=t.prototype,e.prototype=new n,e.prototype.constructor=e}},function(e,t,n){"use strict";(function(t){var r=n(10); | ||
/*! | ||
@@ -7,3 +7,3 @@ * The buffer module from node.js, for the browser. | ||
* @license MIT | ||
*/function o(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0}function i(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var u=n(2),s=Object.prototype.hasOwnProperty,c=Array.prototype.slice,a="foo"===function(){}.name;function f(e){return Object.prototype.toString.call(e)}function l(e){return!i(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var p=e.exports=d,h=/\s*function\s+([^\(\s]*)\s*/;function y(e){if(u.isFunction(e)){if(a)return e.name;var t=e.toString().match(h);return t&&t[1]}}function m(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function v(e){if(a||!u.isFunction(e))return u.inspect(e);var t=y(e);return"[Function"+(t?": "+t:"")+"]"}function g(e,t,n,r,o){throw new p.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:o})}function d(e,t){e||g(e,!0,t,"==",p.ok)}function b(e,t,n,r){if(e===t)return!0;if(i(e)&&i(t))return 0===o(e,t);if(u.isDate(e)&&u.isDate(t))return e.getTime()===t.getTime();if(u.isRegExp(e)&&u.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(l(e)&&l(t)&&f(e)===f(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===o(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(i(e)!==i(t))return!1;var s=(r=r||{actual:[],expected:[]}).actual.indexOf(e);return-1!==s&&s===r.expected.indexOf(t)||(r.actual.push(e),r.expected.push(t),function(e,t,n,r){if(null==e||null==t)return!1;if(u.isPrimitive(e)||u.isPrimitive(t))return e===t;if(n&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var o=w(e),i=w(t);if(o&&!i||!o&&i)return!1;if(o)return e=c.call(e),t=c.call(t),b(e,t,n);var s,a,f=j(e),l=j(t);if(f.length!==l.length)return!1;for(f.sort(),l.sort(),a=f.length-1;a>=0;a--)if(f[a]!==l[a])return!1;for(a=f.length-1;a>=0;a--)if(s=f[a],!b(e[s],t[s],n,r))return!1;return!0}(e,t,n,r))}return n?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function O(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function E(e,t,n,r){var o;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),o=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!o&&g(o,n,"Missing expected exception"+r);var i="string"==typeof r,s=!e&&o&&!n;if((!e&&u.isError(o)&&i&&O(o,n)||s)&&g(o,n,"Got unwanted exception"+r),e&&o&&n&&!O(o,n)||!e&&o)throw o}p.AssertionError=function(e){var t;this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=m(v((t=this).actual),128)+" "+t.operator+" "+m(v(t.expected),128),this.generatedMessage=!0);var n=e.stackStartFunction||g;if(Error.captureStackTrace)Error.captureStackTrace(this,n);else{var r=new Error;if(r.stack){var o=r.stack,i=y(n),u=o.indexOf("\n"+i);if(u>=0){var s=o.indexOf("\n",u+1);o=o.substring(s+1)}this.stack=o}}},u.inherits(p.AssertionError,Error),p.fail=g,p.ok=d,p.equal=function(e,t,n){e!=t&&g(e,t,n,"==",p.equal)},p.notEqual=function(e,t,n){e==t&&g(e,t,n,"!=",p.notEqual)},p.deepEqual=function(e,t,n){b(e,t,!1)||g(e,t,n,"deepEqual",p.deepEqual)},p.deepStrictEqual=function(e,t,n){b(e,t,!0)||g(e,t,n,"deepStrictEqual",p.deepStrictEqual)},p.notDeepEqual=function(e,t,n){b(e,t,!1)&&g(e,t,n,"notDeepEqual",p.notDeepEqual)},p.notDeepStrictEqual=function e(t,n,r){b(t,n,!0)&&g(t,n,r,"notDeepStrictEqual",e)},p.strictEqual=function(e,t,n){e!==t&&g(e,t,n,"===",p.strictEqual)},p.notStrictEqual=function(e,t,n){e===t&&g(e,t,n,"!==",p.notStrictEqual)},p.throws=function(e,t,n){E(!0,e,t,n)},p.doesNotThrow=function(e,t,n){E(!1,e,t,n)},p.ifError=function(e){if(e)throw e},p.strict=r((function e(t,n){t||g(t,!0,n,"==",e)}),p,{equal:p.strictEqual,deepEqual:p.deepStrictEqual,notEqual:p.notStrictEqual,notDeepEqual:p.notDeepStrictEqual}),p.strict.strict=p.strict;var j=Object.keys||function(e){var t=[];for(var n in e)s.call(e,n)&&t.push(n);return t}}).call(this,n(1))},function(e,t,n){"use strict"; | ||
*/function o(e,t){if(e===t)return 0;for(var n=e.length,r=t.length,o=0,i=Math.min(n,r);o<i;++o)if(e[o]!==t[o]){n=e[o],r=t[o];break}return n<r?-1:r<n?1:0}function i(e){return t.Buffer&&"function"==typeof t.Buffer.isBuffer?t.Buffer.isBuffer(e):!(null==e||!e._isBuffer)}var u=n(2),c=Object.prototype.hasOwnProperty,s=Array.prototype.slice,a="foo"===function(){}.name;function f(e){return Object.prototype.toString.call(e)}function l(e){return!i(e)&&("function"==typeof t.ArrayBuffer&&("function"==typeof ArrayBuffer.isView?ArrayBuffer.isView(e):!!e&&(e instanceof DataView||!!(e.buffer&&e.buffer instanceof ArrayBuffer))))}var p=e.exports=g,h=/\s*function\s+([^\(\s]*)\s*/;function y(e){if(u.isFunction(e)){if(a)return e.name;var t=e.toString().match(h);return t&&t[1]}}function m(e,t){return"string"==typeof e?e.length<t?e:e.slice(0,t):e}function v(e){if(a||!u.isFunction(e))return u.inspect(e);var t=y(e);return"[Function"+(t?": "+t:"")+"]"}function d(e,t,n,r,o){throw new p.AssertionError({message:n,actual:e,expected:t,operator:r,stackStartFunction:o})}function g(e,t){e||d(e,!0,t,"==",p.ok)}function b(e,t,n,r){if(e===t)return!0;if(i(e)&&i(t))return 0===o(e,t);if(u.isDate(e)&&u.isDate(t))return e.getTime()===t.getTime();if(u.isRegExp(e)&&u.isRegExp(t))return e.source===t.source&&e.global===t.global&&e.multiline===t.multiline&&e.lastIndex===t.lastIndex&&e.ignoreCase===t.ignoreCase;if(null!==e&&"object"==typeof e||null!==t&&"object"==typeof t){if(l(e)&&l(t)&&f(e)===f(t)&&!(e instanceof Float32Array||e instanceof Float64Array))return 0===o(new Uint8Array(e.buffer),new Uint8Array(t.buffer));if(i(e)!==i(t))return!1;var c=(r=r||{actual:[],expected:[]}).actual.indexOf(e);return-1!==c&&c===r.expected.indexOf(t)||(r.actual.push(e),r.expected.push(t),function(e,t,n,r){if(null==e||null==t)return!1;if(u.isPrimitive(e)||u.isPrimitive(t))return e===t;if(n&&Object.getPrototypeOf(e)!==Object.getPrototypeOf(t))return!1;var o=w(e),i=w(t);if(o&&!i||!o&&i)return!1;if(o)return e=s.call(e),t=s.call(t),b(e,t,n);var c,a,f=j(e),l=j(t);if(f.length!==l.length)return!1;for(f.sort(),l.sort(),a=f.length-1;a>=0;a--)if(f[a]!==l[a])return!1;for(a=f.length-1;a>=0;a--)if(c=f[a],!b(e[c],t[c],n,r))return!1;return!0}(e,t,n,r))}return n?e===t:e==t}function w(e){return"[object Arguments]"==Object.prototype.toString.call(e)}function O(e,t){if(!e||!t)return!1;if("[object RegExp]"==Object.prototype.toString.call(t))return t.test(e);try{if(e instanceof t)return!0}catch(e){}return!Error.isPrototypeOf(t)&&!0===t.call({},e)}function E(e,t,n,r){var o;if("function"!=typeof t)throw new TypeError('"block" argument must be a function');"string"==typeof n&&(r=n,n=null),o=function(e){var t;try{e()}catch(e){t=e}return t}(t),r=(n&&n.name?" ("+n.name+").":".")+(r?" "+r:"."),e&&!o&&d(o,n,"Missing expected exception"+r);var i="string"==typeof r,c=!e&&o&&!n;if((!e&&u.isError(o)&&i&&O(o,n)||c)&&d(o,n,"Got unwanted exception"+r),e&&o&&n&&!O(o,n)||!e&&o)throw o}p.AssertionError=function(e){var t;this.name="AssertionError",this.actual=e.actual,this.expected=e.expected,this.operator=e.operator,e.message?(this.message=e.message,this.generatedMessage=!1):(this.message=m(v((t=this).actual),128)+" "+t.operator+" "+m(v(t.expected),128),this.generatedMessage=!0);var n=e.stackStartFunction||d;if(Error.captureStackTrace)Error.captureStackTrace(this,n);else{var r=new Error;if(r.stack){var o=r.stack,i=y(n),u=o.indexOf("\n"+i);if(u>=0){var c=o.indexOf("\n",u+1);o=o.substring(c+1)}this.stack=o}}},u.inherits(p.AssertionError,Error),p.fail=d,p.ok=g,p.equal=function(e,t,n){e!=t&&d(e,t,n,"==",p.equal)},p.notEqual=function(e,t,n){e==t&&d(e,t,n,"!=",p.notEqual)},p.deepEqual=function(e,t,n){b(e,t,!1)||d(e,t,n,"deepEqual",p.deepEqual)},p.deepStrictEqual=function(e,t,n){b(e,t,!0)||d(e,t,n,"deepStrictEqual",p.deepStrictEqual)},p.notDeepEqual=function(e,t,n){b(e,t,!1)&&d(e,t,n,"notDeepEqual",p.notDeepEqual)},p.notDeepStrictEqual=function e(t,n,r){b(t,n,!0)&&d(t,n,r,"notDeepStrictEqual",e)},p.strictEqual=function(e,t,n){e!==t&&d(e,t,n,"===",p.strictEqual)},p.notStrictEqual=function(e,t,n){e===t&&d(e,t,n,"!==",p.notStrictEqual)},p.throws=function(e,t,n){E(!0,e,t,n)},p.doesNotThrow=function(e,t,n){E(!1,e,t,n)},p.ifError=function(e){if(e)throw e},p.strict=r((function e(t,n){t||d(t,!0,n,"==",e)}),p,{equal:p.strictEqual,deepEqual:p.deepStrictEqual,notEqual:p.notStrictEqual,notDeepEqual:p.notDeepStrictEqual}),p.strict.strict=p.strict;var j=Object.keys||function(e){var t=[];for(var n in e)c.call(e,n)&&t.push(n);return t}}).call(this,n(1))},function(e,t,n){"use strict"; | ||
/* | ||
@@ -13,3 +13,3 @@ object-assign | ||
@license MIT | ||
*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function u(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,s,c=u(e),a=1;a<arguments.length;a++){for(var f in n=Object(arguments[a]))o.call(n,f)&&(c[f]=n[f]);if(r){s=r(n);for(var l=0;l<s.length;l++)i.call(n,s[l])&&(c[s[l]]=n[s[l]])}}return c}},function(e,t){e.exports=function(){return(new Date).getTime()}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(e){return(u=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var c=Symbol("window"),a=Symbol("buckets"),f=Symbol("timeout"),l=Symbol("percentiles"),p=Symbol("bucket-interval"),h=Symbol("snapshot-interval"),y=function(e){function t(e){var n;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,t),(n=i(this,u(t).call(this)))[a]=e.rollingCountBuckets,n[f]=e.rollingCountTimeout,n[c]=new Array(n[a]),n[l]=[0,.25,.5,.75,.9,.95,.99,.995,1],n.rollingPercentilesEnabled=e.rollingPercentilesEnabled;for(var r=0;r<n[a];r++)n[c][r]=v();var o=Math.floor(n[f]/n[a]);return n[p]=setInterval(m(n[c]),o),"function"==typeof n[p].unref&&n[p].unref(),n[h]=setInterval((function(e){return n.emit("snapshot",n.stats)}),o),"function"==typeof n[h].unref&&n[h].unref(),n}var n,r,y;return function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(t,e),n=t,(r=[{key:"increment",value:function(e,t){this[c][0][e]++,"successes"!==e&&"failures"!==e&&"timeouts"!==e||this[c][0].latencyTimes.push(t||0)}},{key:"open",value:function(){this[c][0].isCircuitBreakerOpen=!0}},{key:"close",value:function(){this[c][0].isCircuitBreakerOpen=!1}},{key:"shutdown",value:function(){this.removeAllListeners(),clearInterval(this[p]),clearInterval(this[h])}},{key:"stats",get:function(){var e=this,t=this[c].reduce((function(t,n){return n?(Object.keys(t).forEach((function(e){"latencyTimes"!==e&&"percentiles"!==e&&(t[e]+=n[e]||0)})),e.rollingPercentilesEnabled&&t.latencyTimes.push.apply(t.latencyTimes,n.latencyTimes||[]),t):t}),v());return this.rollingPercentilesEnabled?(t.latencyTimes.sort((function(e,t){return e-t})),t.latencyTimes.length?t.latencyMean=t.latencyTimes.reduce((function(e,t){return e+t}),0)/t.latencyTimes.length:t.latencyMean=0,this[l].forEach((function(e){t.percentiles[e]=function(e,t){if(0===e)return t[0]||0;var n=Math.ceil(e*t.length);return t[n-1]||0}(e,t.latencyTimes)}))):(t.latencyMean=-1,this[l].forEach((function(e){t.percentiles[e]=-1}))),t}},{key:"window",get:function(){return this[c].slice()}}])&&o(n.prototype,r),y&&o(n,y),t}(n(3).EventEmitter),m=function(e){return function(t){e.pop(),e.unshift(v())}},v=function(e){return{failures:0,fallbacks:0,successes:0,rejects:0,fires:0,timeouts:0,cacheHits:0,cacheMisses:0,semaphoreRejections:0,percentiles:{},latencyTimes:[]}};e.exports=y},function(e,t,n){"use strict";e.exports=function(e){var t=[],n=e,r={take:o,release:i,test:function(){return!(n<1)&&(o()&&!0)}};return Object.defineProperty(r,"count",{get:function(e){return n},enumerable:!0}),r;function o(e){return n>0?(--n,Promise.resolve(i)):new Promise((function(r,o){t.push((function(e){--n,r(i)})),e&&setTimeout((function(n){t.shift();var r=new Error("Timed out after ".concat(e,"ms"));r.code="ETIMEDOUT",o(r)}),e)}))}function i(){n++,t.length>0&&t.shift()()}}}])})); | ||
*/var r=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,i=Object.prototype.propertyIsEnumerable;function u(e){if(null==e)throw new TypeError("Object.assign cannot be called with null or undefined");return Object(e)}e.exports=function(){try{if(!Object.assign)return!1;var e=new String("abc");if(e[5]="de","5"===Object.getOwnPropertyNames(e)[0])return!1;for(var t={},n=0;n<10;n++)t["_"+String.fromCharCode(n)]=n;if("0123456789"!==Object.getOwnPropertyNames(t).map((function(e){return t[e]})).join(""))return!1;var r={};return"abcdefghijklmnopqrst".split("").forEach((function(e){r[e]=e})),"abcdefghijklmnopqrst"===Object.keys(Object.assign({},r)).join("")}catch(e){return!1}}()?Object.assign:function(e,t){for(var n,c,s=u(e),a=1;a<arguments.length;a++){for(var f in n=Object(arguments[a]))o.call(n,f)&&(s[f]=n[f]);if(r){c=r(n);for(var l=0;l<c.length;l++)i.call(n,c[l])&&(s[c[l]]=n[c[l]])}}return s}},function(e,t,n){"use strict";function r(e){return(r="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function o(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t){return!t||"object"!==r(t)&&"function"!=typeof t?function(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}(e):t}function u(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function c(e){return(c=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}var a=Symbol("window"),f=Symbol("buckets"),l=Symbol("timeout"),p=Symbol("percentiles"),h=Symbol("bucket-interval"),y=Symbol("snapshot-interval"),m=function(e){!function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&s(e,t)}(b,e);var t,n,r,m,g=(t=b,function(){var e,n=c(t);if(u()){var r=c(this).constructor;e=Reflect.construct(n,arguments,r)}else e=n.apply(this,arguments);return i(this,e)});function b(e){var t;!function(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}(this,b),(t=g.call(this))[f]=e.rollingCountBuckets,t[l]=e.rollingCountTimeout,t[a]=new Array(t[f]),t[p]=[0,.25,.5,.75,.9,.95,.99,.995,1],t.rollingPercentilesEnabled=e.rollingPercentilesEnabled;for(var n=0;n<t[f];n++)t[a][n]=d();var r=Math.floor(t[l]/t[f]);return t[h]=setInterval(v(t[a]),r),"function"==typeof t[h].unref&&t[h].unref(),t[y]=setInterval((function(e){return t.emit("snapshot",t.stats)}),r),"function"==typeof t[y].unref&&t[y].unref(),t}return n=b,(r=[{key:"increment",value:function(e,t){this[a][0][e]++,"successes"!==e&&"failures"!==e&&"timeouts"!==e||this[a][0].latencyTimes.push(t||0)}},{key:"open",value:function(){this[a][0].isCircuitBreakerOpen=!0}},{key:"close",value:function(){this[a][0].isCircuitBreakerOpen=!1}},{key:"shutdown",value:function(){this.removeAllListeners(),clearInterval(this[h]),clearInterval(this[y])}},{key:"stats",get:function(){var e=this,t=this[a].reduce((function(t,n){return n?(Object.keys(t).forEach((function(e){"latencyTimes"!==e&&"percentiles"!==e&&(t[e]+=n[e]||0)})),e.rollingPercentilesEnabled&&t.latencyTimes.push.apply(t.latencyTimes,n.latencyTimes||[]),t):t}),d());return this.rollingPercentilesEnabled?(t.latencyTimes.sort((function(e,t){return e-t})),t.latencyTimes.length?t.latencyMean=t.latencyTimes.reduce((function(e,t){return e+t}),0)/t.latencyTimes.length:t.latencyMean=0,this[p].forEach((function(e){t.percentiles[e]=function(e,t){if(0===e)return t[0]||0;var n=Math.ceil(e*t.length);return t[n-1]||0}(e,t.latencyTimes)}))):(t.latencyMean=-1,this[p].forEach((function(e){t.percentiles[e]=-1}))),t}},{key:"window",get:function(){return this[a].slice()}}])&&o(n.prototype,r),m&&o(n,m),b}(n(3).EventEmitter),v=function(e){return function(t){e.pop(),e.unshift(d())}},d=function(e){return{failures:0,fallbacks:0,successes:0,rejects:0,fires:0,timeouts:0,cacheHits:0,cacheMisses:0,semaphoreRejections:0,percentiles:{},latencyTimes:[]}};e.exports=m},function(e,t,n){"use strict";e.exports=function(e){var t=[],n=e,r={take:o,release:i,test:function(){return!(n<1)&&(o()&&!0)}};return Object.defineProperty(r,"count",{get:function(e){return n},enumerable:!0}),r;function o(e){return n>0?(--n,Promise.resolve(i)):new Promise((function(r,o){t.push((function(e){--n,r(i)})),e&&setTimeout((function(n){t.shift();var r=new Error("Timed out after ".concat(e,"ms"));r.code="ETIMEDOUT",o(r)}),e)}))}function i(){n++,t.length>0&&t.shift()()}}}])})); | ||
//# sourceMappingURL=opossum.min.map |
@@ -67,6 +67,6 @@ 'use strict'; | ||
* without opening the circuit during a brief warmup period (this is the | ||
* `rollingCountDuration` property). Default: false | ||
* `rollingCountTimeout` property). Default: false | ||
* allow before enabling the circuit. This can help in situations where no | ||
* matter what your `errorThresholdPercentage` is, if the first execution | ||
* times out or fails, the circuit immediately opens. Default: 0 | ||
* times out or fails, the circuit immediately opens. | ||
* @param {Number} options.volumeThreshold the minimum number of requests within | ||
@@ -73,0 +73,0 @@ * the rolling statistical window that must exist before the circuit breaker |
{ | ||
"name": "opossum", | ||
"version": "5.0.0", | ||
"version": "5.0.1", | ||
"author": "Red Hat, Inc.", | ||
@@ -40,5 +40,2 @@ "license": "Apache-2.0", | ||
"files": [ | ||
"package.json", | ||
"README.md", | ||
"LICENSE", | ||
"index.js", | ||
@@ -54,17 +51,17 @@ "lib", | ||
"devDependencies": { | ||
"@babel/core": "^7.6.4", | ||
"@babel/preset-env": "^7.6.3", | ||
"@babel/core": "^7.11.0", | ||
"@babel/preset-env": "^7.11.0", | ||
"babel-loader": "^8.0.6", | ||
"codacy-coverage": "^3.4.0", | ||
"coveralls": "^3.0.3", | ||
"documentation": "^12.0.0", | ||
"nyc": "~15.0.0", | ||
"coveralls": "^3.1.0", | ||
"documentation": "^13.0.2", | ||
"nyc": "~15.1.0", | ||
"opener": "1.5.1", | ||
"serve": "^11.0.0", | ||
"standard-version": "7.1.0", | ||
"serve": "^11.3.2", | ||
"standard-version": "9.0.0", | ||
"standardx": "^5.0.0", | ||
"tap-spec": "~5.0.0", | ||
"tape": "~4.13.0", | ||
"webpack": "~4.41.0", | ||
"webpack-cli": "~3.3.0" | ||
"tape": "~5.0.1", | ||
"webpack": "~4.44.1", | ||
"webpack-cli": "~3.3.12" | ||
}, | ||
@@ -71,0 +68,0 @@ "description": "A fail-fast circuit breaker for promises and callbacks", |
@@ -23,7 +23,6 @@ # opossum [![CircleCI](https://circleci.com/gh/nodeshift/opossum/tree/master.svg?style=svg&circle-token=0742302baa8c95cef354997ea52a383d3d078ff1)](https://circleci.com/gh/nodeshift/opossum/tree/master) | ||
| License: | Apache-2.0 | | ||
| Build: | make | | ||
| Documentation: | https://nodeshift.dev/opossum/ | | ||
| Typings: | https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/opossum | ||
| Issue tracker: | https://github.com/nodeshift/opossum/issues | | ||
| Engines: | Node.js 8.x, 10.x, 11.x, 12.x | | ||
| Engines: | Node.js >= 10 | | ||
@@ -30,0 +29,0 @@ ## Usage |
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
794498
3981
274