New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

capillaries

Package Overview
Dependencies
Maintainers
1
Versions
22
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

capillaries - npm Package Compare versions

Comparing version 3.0.2 to 3.1.0

142

capillaries.esm.js
/*!
* @module capillaries
* @description Javascript Events
* @version 3.0.2
* @version 3.1.0
* @link https://github.com/sibiraj-s/capillaries.git

@@ -313,97 +313,72 @@ * @licence MIT License, https://opensource.org/licenses/MIT

function _classPrivateFieldGet(receiver, privateMap) {
var descriptor = privateMap.get(receiver);
var Events = /*#__PURE__*/function (_Map) {
_inherits(Events, _Map);
if (!descriptor) {
throw new TypeError("attempted to get private field on non-instance");
}
var _super = _createSuper(Events);
if (descriptor.get) {
return descriptor.get.call(receiver);
}
function Events() {
var _this;
return descriptor.value;
}
_classCallCheck(this, Events);
function _classPrivateFieldSet(receiver, privateMap, value) {
var descriptor = privateMap.get(receiver);
_this = _super.call(this);
if (!descriptor) {
throw new TypeError("attempted to set private field on non-instance");
}
_defineProperty(_assertThisInitialized(_this), "on", function (type, listener) {
var ctx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
if (descriptor.set) {
descriptor.set.call(receiver, value);
} else {
if (!descriptor.writable) {
throw new TypeError("attempted to set read only private field");
}
if (typeof listener !== 'function') {
throw new TypeError('Event Listener must be a function');
}
descriptor.value = value;
}
var event = _this.get(type) || [];
event.push([listener, ctx]);
return value;
}
_this.set(type, event);
var _events = new WeakMap();
return function () {
var events = _this.get(type) || [];
var Events = function Events() {
var _this = this;
_this.set(type, events.filter(function (e) {
return e[0] !== listener;
}));
};
});
_classCallCheck(this, Events);
_defineProperty(_assertThisInitialized(_this), "emit", function (type) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
_events.set(this, {
writable: true,
value: {}
});
var starEvents = type === '*' ? [] : _this.get('*') || [];
var eventList = (_this.get(type) || []).concat(starEvents);
eventList.forEach(function (event) {
var _event = _slicedToArray(event, 2),
listenerFn = _event[0],
ctx = _event[1];
_defineProperty(this, "on", function (type, listener) {
var ctx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
if (typeof listener !== 'function') {
throw new TypeError('Event Listener must be a function');
}
var event = _classPrivateFieldGet(_this, _events)[type] || [];
event.push([listener, ctx]);
_classPrivateFieldGet(_this, _events)[type] = event;
return function () {
_classPrivateFieldGet(_this, _events)[type] = (_classPrivateFieldGet(_this, _events)[type] || []).filter(function (e) {
return e[0] !== listener;
listenerFn.apply(ctx, args);
});
};
});
});
_defineProperty(this, "emit", function (type) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
_defineProperty(_assertThisInitialized(_this), "unbindAll", function (type) {
if (type) {
_this["delete"](type);
var starEvents = type === '*' ? [] : _classPrivateFieldGet(_this, _events)['*'] || [];
var eventList = (_classPrivateFieldGet(_this, _events)[type] || []).concat(starEvents);
eventList.forEach(function (event) {
var _event = _slicedToArray(event, 2),
listenerFn = _event[0],
ctx = _event[1];
return;
}
listenerFn.apply(ctx, args);
_this.clear();
});
});
_defineProperty(this, "unbindAll", function (type) {
if (type) {
delete _classPrivateFieldGet(_this, _events)[type];
return;
}
Object.freeze(_assertThisInitialized(_this));
return _this;
}
_classPrivateFieldSet(_this, _events, {});
});
return Events;
}( /*#__PURE__*/_wrapNativeSuper(Map));
var Hooks = /*#__PURE__*/function (_Map2) {
_inherits(Hooks, _Map2);
Object.freeze(this);
};
var Hooks = /*#__PURE__*/function (_Map) {
_inherits(Hooks, _Map);
var _super2 = _createSuper(Hooks);
var _super = _createSuper(Hooks);
function Hooks() {

@@ -414,8 +389,4 @@ var _this2;

for (var _len2 = arguments.length, _args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
_args[_key2] = arguments[_key2];
}
_this2 = _super2.call(this);
_this2 = _super.call.apply(_super, [this].concat(_args));
_defineProperty(_assertThisInitialized(_this2), "tap", function (name, cb) {

@@ -434,3 +405,3 @@ var ctx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

return function () {
var hooks = _this2.get(name);
var hooks = _this2.get(name) || [];

@@ -446,5 +417,5 @@ _this2.set(name, hooks.filter(function (e) {

var hooks,
_len3,
_len2,
args,
_key3,
_key2,
_iterator,

@@ -455,3 +426,3 @@ _step,

ctx,
_args2 = arguments;
_args = arguments;

@@ -472,4 +443,4 @@ return regeneratorRuntime.wrap(function _callee$(_context) {

case 3:
for (_len3 = _args2.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
args[_key3 - 1] = _args2[_key3];
for (_len2 = _args.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = _args[_key2];
}

@@ -654,2 +625,3 @@

Object.freeze(_assertThisInitialized(_this2));
return _this2;

@@ -656,0 +628,0 @@ }

/*!
* @module capillaries
* @description Javascript Events
* @version 3.0.2
* @version 3.1.0
* @link https://github.com/sibiraj-s/capillaries.git
* @licence MIT License, https://opensource.org/licenses/MIT
*/
function asyncGeneratorStep(e,t,r,n,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){asyncGeneratorStep(a,n,o,i,c,"next",e)}function c(e){asyncGeneratorStep(a,n,o,i,c,"throw",e)}i(void 0)}))}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _inherits(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&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct(){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 _construct(e,t,r){return(_construct=_isNativeReflectConstruct()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&_setPrototypeOf(o,r.prototype),o}).apply(null,arguments)}function _isNativeFunction(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function _wrapNativeSuper(e){var t="function"==typeof Map?new Map:void 0;return(_wrapNativeSuper=function(e){if(null===e||!_isNativeFunction(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(r,e)})(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?_assertThisInitialized(e):t}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,n=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw a}}return r}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _createForOfIteratorHelper(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){c=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw a}}}}function _classPrivateFieldGet(e,t){var r=t.get(e);if(!r)throw new TypeError("attempted to get private field on non-instance");return r.get?r.get.call(e):r.value}function _classPrivateFieldSet(e,t,r){var n=t.get(e);if(!n)throw new TypeError("attempted to set private field on non-instance");if(n.set)n.set.call(e,r);else{if(!n.writable)throw new TypeError("attempted to set read only private field");n.value=r}return r}var _events=new WeakMap,Events=function e(){var t=this;_classCallCheck(this,e),_events.set(this,{writable:!0,value:{}}),_defineProperty(this,"on",(function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("function"!=typeof r)throw new TypeError("Event Listener must be a function");var o=_classPrivateFieldGet(t,_events)[e]||[];return o.push([r,n]),_classPrivateFieldGet(t,_events)[e]=o,function(){_classPrivateFieldGet(t,_events)[e]=(_classPrivateFieldGet(t,_events)[e]||[]).filter((function(e){return e[0]!==r}))}})),_defineProperty(this,"emit",(function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];var a="*"===e?[]:_classPrivateFieldGet(t,_events)["*"]||[],i=(_classPrivateFieldGet(t,_events)[e]||[]).concat(a);i.forEach((function(e){var t=_slicedToArray(e,2),r=t[0],o=t[1];r.apply(o,n)}))})),_defineProperty(this,"unbindAll",(function(e){e?delete _classPrivateFieldGet(t,_events)[e]:_classPrivateFieldSet(t,_events,{})})),Object.freeze(this)},Hooks=function(e){_inherits(r,_wrapNativeSuper(Map));var t=_createSuper(r);function r(){var e;_classCallCheck(this,r);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return _defineProperty(_assertThisInitialized(e=t.call.apply(t,[this].concat(o))),"tap",(function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("function"!=typeof r)throw new TypeError("Callback must be a function");var o=e.get(t)||[];return o.push([r,n]),e.set(t,o),function(){var n=e.get(t);e.set(t,n.filter((function(e){return e[0]!==r})))}})),_defineProperty(_assertThisInitialized(e),"callAsync",function(){var t=_asyncToGenerator(regeneratorRuntime.mark((function t(r){var n,o,a,i,c,u,s,l,f,p=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.get(r)){t.next=3;break}return t.abrupt("return");case 3:for(o=p.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=p[i];c=_createForOfIteratorHelper(n),t.prev=5,c.s();case 7:if((u=c.n()).done){t.next=13;break}return s=_slicedToArray(u.value,2),l=s[0],f=s[1],t.next=11,l.apply(f,a);case 11:t.next=7;break;case 13:t.next=18;break;case 15:t.prev=15,t.t0=t.catch(5),c.e(t.t0);case 18:return t.prev=18,c.f(),t.finish(18);case 21:case"end":return t.stop()}}),t,null,[[5,15,18,21]])})));return function(e){return t.apply(this,arguments)}}()),_defineProperty(_assertThisInitialized(e),"callAsyncWaterFall",function(){var t=_asyncToGenerator(regeneratorRuntime.mark((function t(r,n){var o,a,i,c,u,s,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=n,a=e.get(r)){t.next=4;break}return t.abrupt("return",o);case 4:i=_createForOfIteratorHelper(a),t.prev=5,i.s();case 7:if((c=i.n()).done){t.next=14;break}return u=_slicedToArray(c.value,2),s=u[0],l=u[1],t.next=11,s.call(l,o);case 11:o=t.sent;case 12:t.next=7;break;case 14:t.next=19;break;case 16:t.prev=16,t.t0=t.catch(5),i.e(t.t0);case 19:return t.prev=19,i.f(),t.finish(19);case 22:return t.abrupt("return",o);case 23:case"end":return t.stop()}}),t,null,[[5,16,19,22]])})));return function(e,r){return t.apply(this,arguments)}}()),_defineProperty(_assertThisInitialized(e),"call",(function(t,r){var n=e.get(t);if(n){var o,a=_createForOfIteratorHelper(n);try{for(a.s();!(o=a.n()).done;){var i=_slicedToArray(o.value,2),c=i[0],u=i[1];c.call(r,u)}}catch(e){a.e(e)}finally{a.f()}}})),_defineProperty(_assertThisInitialized(e),"callWaterFall",(function(t,r){var n=r,o=e.get(t);if(!o)return n;var a,i=_createForOfIteratorHelper(o);try{for(i.s();!(a=i.n()).done;){var c=_slicedToArray(a.value,2),u=c[0],s=c[1];n=u.call(s,n)}}catch(e){i.e(e)}finally{i.f()}return n})),e}return r}();export default Events;export{Events,Hooks};
function asyncGeneratorStep(e,t,r,n,o,a,i){try{var u=e[a](i),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){asyncGeneratorStep(a,n,o,i,u,"next",e)}function u(e){asyncGeneratorStep(a,n,o,i,u,"throw",e)}i(void 0)}))}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _inherits(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&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct(){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 _construct(e,t,r){return(_construct=_isNativeReflectConstruct()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&_setPrototypeOf(o,r.prototype),o}).apply(null,arguments)}function _isNativeFunction(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function _wrapNativeSuper(e){var t="function"==typeof Map?new Map:void 0;return(_wrapNativeSuper=function(e){if(null===e||!_isNativeFunction(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(r,e)})(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?_assertThisInitialized(e):t}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,n=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return r}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _createForOfIteratorHelper(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}var Events=function(e){_inherits(r,_wrapNativeSuper(Map));var t=_createSuper(r);function r(){var e;return _classCallCheck(this,r),_defineProperty(_assertThisInitialized(e=t.call(this)),"on",(function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("function"!=typeof r)throw new TypeError("Event Listener must be a function");var o=e.get(t)||[];return o.push([r,n]),e.set(t,o),function(){var n=e.get(t)||[];e.set(t,n.filter((function(e){return e[0]!==r})))}})),_defineProperty(_assertThisInitialized(e),"emit",(function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];var a="*"===t?[]:e.get("*")||[],i=(e.get(t)||[]).concat(a);i.forEach((function(e){var t=_slicedToArray(e,2),r=t[0],o=t[1];r.apply(o,n)}))})),_defineProperty(_assertThisInitialized(e),"unbindAll",(function(t){t?e.delete(t):e.clear()})),Object.freeze(_assertThisInitialized(e)),e}return r}(),Hooks=function(e){_inherits(r,_wrapNativeSuper(Map));var t=_createSuper(r);function r(){var e;return _classCallCheck(this,r),_defineProperty(_assertThisInitialized(e=t.call(this)),"tap",(function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("function"!=typeof r)throw new TypeError("Callback must be a function");var o=e.get(t)||[];return o.push([r,n]),e.set(t,o),function(){var n=e.get(t)||[];e.set(t,n.filter((function(e){return e[0]!==r})))}})),_defineProperty(_assertThisInitialized(e),"callAsync",function(){var t=_asyncToGenerator(regeneratorRuntime.mark((function t(r){var n,o,a,i,u,c,s,f,l,p=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.get(r)){t.next=3;break}return t.abrupt("return");case 3:for(o=p.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=p[i];u=_createForOfIteratorHelper(n),t.prev=5,u.s();case 7:if((c=u.n()).done){t.next=13;break}return s=_slicedToArray(c.value,2),f=s[0],l=s[1],t.next=11,f.apply(l,a);case 11:t.next=7;break;case 13:t.next=18;break;case 15:t.prev=15,t.t0=t.catch(5),u.e(t.t0);case 18:return t.prev=18,u.f(),t.finish(18);case 21:case"end":return t.stop()}}),t,null,[[5,15,18,21]])})));return function(e){return t.apply(this,arguments)}}()),_defineProperty(_assertThisInitialized(e),"callAsyncWaterFall",function(){var t=_asyncToGenerator(regeneratorRuntime.mark((function t(r,n){var o,a,i,u,c,s,f;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=n,a=e.get(r)){t.next=4;break}return t.abrupt("return",o);case 4:i=_createForOfIteratorHelper(a),t.prev=5,i.s();case 7:if((u=i.n()).done){t.next=14;break}return c=_slicedToArray(u.value,2),s=c[0],f=c[1],t.next=11,s.call(f,o);case 11:o=t.sent;case 12:t.next=7;break;case 14:t.next=19;break;case 16:t.prev=16,t.t0=t.catch(5),i.e(t.t0);case 19:return t.prev=19,i.f(),t.finish(19);case 22:return t.abrupt("return",o);case 23:case"end":return t.stop()}}),t,null,[[5,16,19,22]])})));return function(e,r){return t.apply(this,arguments)}}()),_defineProperty(_assertThisInitialized(e),"call",(function(t,r){var n=e.get(t);if(n){var o,a=_createForOfIteratorHelper(n);try{for(a.s();!(o=a.n()).done;){var i=_slicedToArray(o.value,2),u=i[0],c=i[1];u.call(r,c)}}catch(e){a.e(e)}finally{a.f()}}})),_defineProperty(_assertThisInitialized(e),"callWaterFall",(function(t,r){var n=r,o=e.get(t);if(!o)return n;var a,i=_createForOfIteratorHelper(o);try{for(i.s();!(a=i.n()).done;){var u=_slicedToArray(a.value,2),c=u[0],s=u[1];n=c.call(s,n)}}catch(e){i.e(e)}finally{i.f()}return n})),Object.freeze(_assertThisInitialized(e)),e}return r}();export default Events;export{Events,Hooks};
//# sourceMappingURL=capillaries.esm.min.js.map
/*!
* @module capillaries
* @description Javascript Events
* @version 3.0.2
* @version 3.1.0
* @link https://github.com/sibiraj-s/capillaries.git

@@ -317,97 +317,72 @@ * @licence MIT License, https://opensource.org/licenses/MIT

function _classPrivateFieldGet(receiver, privateMap) {
var descriptor = privateMap.get(receiver);
var Events = /*#__PURE__*/function (_Map) {
_inherits(Events, _Map);
if (!descriptor) {
throw new TypeError("attempted to get private field on non-instance");
}
var _super = _createSuper(Events);
if (descriptor.get) {
return descriptor.get.call(receiver);
}
function Events() {
var _this;
return descriptor.value;
}
_classCallCheck(this, Events);
function _classPrivateFieldSet(receiver, privateMap, value) {
var descriptor = privateMap.get(receiver);
_this = _super.call(this);
if (!descriptor) {
throw new TypeError("attempted to set private field on non-instance");
}
_defineProperty(_assertThisInitialized(_this), "on", function (type, listener) {
var ctx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
if (descriptor.set) {
descriptor.set.call(receiver, value);
} else {
if (!descriptor.writable) {
throw new TypeError("attempted to set read only private field");
}
if (typeof listener !== 'function') {
throw new TypeError('Event Listener must be a function');
}
descriptor.value = value;
}
var event = _this.get(type) || [];
event.push([listener, ctx]);
return value;
}
_this.set(type, event);
var _events = new WeakMap();
return function () {
var events = _this.get(type) || [];
var Events = function Events() {
var _this = this;
_this.set(type, events.filter(function (e) {
return e[0] !== listener;
}));
};
});
_classCallCheck(this, Events);
_defineProperty(_assertThisInitialized(_this), "emit", function (type) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
_events.set(this, {
writable: true,
value: {}
});
var starEvents = type === '*' ? [] : _this.get('*') || [];
var eventList = (_this.get(type) || []).concat(starEvents);
eventList.forEach(function (event) {
var _event = _slicedToArray(event, 2),
listenerFn = _event[0],
ctx = _event[1];
_defineProperty(this, "on", function (type, listener) {
var ctx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
if (typeof listener !== 'function') {
throw new TypeError('Event Listener must be a function');
}
var event = _classPrivateFieldGet(_this, _events)[type] || [];
event.push([listener, ctx]);
_classPrivateFieldGet(_this, _events)[type] = event;
return function () {
_classPrivateFieldGet(_this, _events)[type] = (_classPrivateFieldGet(_this, _events)[type] || []).filter(function (e) {
return e[0] !== listener;
listenerFn.apply(ctx, args);
});
};
});
});
_defineProperty(this, "emit", function (type) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
_defineProperty(_assertThisInitialized(_this), "unbindAll", function (type) {
if (type) {
_this["delete"](type);
var starEvents = type === '*' ? [] : _classPrivateFieldGet(_this, _events)['*'] || [];
var eventList = (_classPrivateFieldGet(_this, _events)[type] || []).concat(starEvents);
eventList.forEach(function (event) {
var _event = _slicedToArray(event, 2),
listenerFn = _event[0],
ctx = _event[1];
return;
}
listenerFn.apply(ctx, args);
_this.clear();
});
});
_defineProperty(this, "unbindAll", function (type) {
if (type) {
delete _classPrivateFieldGet(_this, _events)[type];
return;
}
Object.freeze(_assertThisInitialized(_this));
return _this;
}
_classPrivateFieldSet(_this, _events, {});
});
return Events;
}( /*#__PURE__*/_wrapNativeSuper(Map));
var Hooks = /*#__PURE__*/function (_Map2) {
_inherits(Hooks, _Map2);
Object.freeze(this);
};
var Hooks = /*#__PURE__*/function (_Map) {
_inherits(Hooks, _Map);
var _super2 = _createSuper(Hooks);
var _super = _createSuper(Hooks);
function Hooks() {

@@ -418,8 +393,4 @@ var _this2;

for (var _len2 = arguments.length, _args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
_args[_key2] = arguments[_key2];
}
_this2 = _super2.call(this);
_this2 = _super.call.apply(_super, [this].concat(_args));
_defineProperty(_assertThisInitialized(_this2), "tap", function (name, cb) {

@@ -438,3 +409,3 @@ var ctx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

return function () {
var hooks = _this2.get(name);
var hooks = _this2.get(name) || [];

@@ -450,5 +421,5 @@ _this2.set(name, hooks.filter(function (e) {

var hooks,
_len3,
_len2,
args,
_key3,
_key2,
_iterator,

@@ -459,3 +430,3 @@ _step,

ctx,
_args2 = arguments;
_args = arguments;

@@ -476,4 +447,4 @@ return regeneratorRuntime.wrap(function _callee$(_context) {

case 3:
for (_len3 = _args2.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
args[_key3 - 1] = _args2[_key3];
for (_len2 = _args.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = _args[_key2];
}

@@ -658,2 +629,3 @@

Object.freeze(_assertThisInitialized(_this2));
return _this2;

@@ -660,0 +632,0 @@ }

/*!
* @module capillaries
* @description Javascript Events
* @version 3.0.2
* @version 3.1.0
* @link https://github.com/sibiraj-s/capillaries.git
* @licence MIT License, https://opensource.org/licenses/MIT
*/
"use strict";function asyncGeneratorStep(e,t,r,n,o,a,i){try{var c=e[a](i),u=c.value}catch(e){return void r(e)}c.done?t(u):Promise.resolve(u).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){asyncGeneratorStep(a,n,o,i,c,"next",e)}function c(e){asyncGeneratorStep(a,n,o,i,c,"throw",e)}i(void 0)}))}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _inherits(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&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct(){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 _construct(e,t,r){return(_construct=_isNativeReflectConstruct()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&_setPrototypeOf(o,r.prototype),o}).apply(null,arguments)}function _isNativeFunction(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function _wrapNativeSuper(e){var t="function"==typeof Map?new Map:void 0;return(_wrapNativeSuper=function(e){if(null===e||!_isNativeFunction(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(r,e)})(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?_assertThisInitialized(e):t}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,n=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,a=void 0;try{for(var i,c=e[Symbol.iterator]();!(n=(i=c.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==c.return||c.return()}finally{if(o)throw a}}return r}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _createForOfIteratorHelper(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,c=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){c=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(c)throw a}}}}function _classPrivateFieldGet(e,t){var r=t.get(e);if(!r)throw new TypeError("attempted to get private field on non-instance");return r.get?r.get.call(e):r.value}function _classPrivateFieldSet(e,t,r){var n=t.get(e);if(!n)throw new TypeError("attempted to set private field on non-instance");if(n.set)n.set.call(e,r);else{if(!n.writable)throw new TypeError("attempted to set read only private field");n.value=r}return r}Object.defineProperty(exports,"__esModule",{value:!0});var _events=new WeakMap,Events=function e(){var t=this;_classCallCheck(this,e),_events.set(this,{writable:!0,value:{}}),_defineProperty(this,"on",(function(e,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("function"!=typeof r)throw new TypeError("Event Listener must be a function");var o=_classPrivateFieldGet(t,_events)[e]||[];return o.push([r,n]),_classPrivateFieldGet(t,_events)[e]=o,function(){_classPrivateFieldGet(t,_events)[e]=(_classPrivateFieldGet(t,_events)[e]||[]).filter((function(e){return e[0]!==r}))}})),_defineProperty(this,"emit",(function(e){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];var a="*"===e?[]:_classPrivateFieldGet(t,_events)["*"]||[],i=(_classPrivateFieldGet(t,_events)[e]||[]).concat(a);i.forEach((function(e){var t=_slicedToArray(e,2),r=t[0],o=t[1];r.apply(o,n)}))})),_defineProperty(this,"unbindAll",(function(e){e?delete _classPrivateFieldGet(t,_events)[e]:_classPrivateFieldSet(t,_events,{})})),Object.freeze(this)},Hooks=function(e){_inherits(r,_wrapNativeSuper(Map));var t=_createSuper(r);function r(){var e;_classCallCheck(this,r);for(var n=arguments.length,o=new Array(n),a=0;a<n;a++)o[a]=arguments[a];return _defineProperty(_assertThisInitialized(e=t.call.apply(t,[this].concat(o))),"tap",(function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("function"!=typeof r)throw new TypeError("Callback must be a function");var o=e.get(t)||[];return o.push([r,n]),e.set(t,o),function(){var n=e.get(t);e.set(t,n.filter((function(e){return e[0]!==r})))}})),_defineProperty(_assertThisInitialized(e),"callAsync",function(){var t=_asyncToGenerator(regeneratorRuntime.mark((function t(r){var n,o,a,i,c,u,s,l,f,p=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.get(r)){t.next=3;break}return t.abrupt("return");case 3:for(o=p.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=p[i];c=_createForOfIteratorHelper(n),t.prev=5,c.s();case 7:if((u=c.n()).done){t.next=13;break}return s=_slicedToArray(u.value,2),l=s[0],f=s[1],t.next=11,l.apply(f,a);case 11:t.next=7;break;case 13:t.next=18;break;case 15:t.prev=15,t.t0=t.catch(5),c.e(t.t0);case 18:return t.prev=18,c.f(),t.finish(18);case 21:case"end":return t.stop()}}),t,null,[[5,15,18,21]])})));return function(e){return t.apply(this,arguments)}}()),_defineProperty(_assertThisInitialized(e),"callAsyncWaterFall",function(){var t=_asyncToGenerator(regeneratorRuntime.mark((function t(r,n){var o,a,i,c,u,s,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=n,a=e.get(r)){t.next=4;break}return t.abrupt("return",o);case 4:i=_createForOfIteratorHelper(a),t.prev=5,i.s();case 7:if((c=i.n()).done){t.next=14;break}return u=_slicedToArray(c.value,2),s=u[0],l=u[1],t.next=11,s.call(l,o);case 11:o=t.sent;case 12:t.next=7;break;case 14:t.next=19;break;case 16:t.prev=16,t.t0=t.catch(5),i.e(t.t0);case 19:return t.prev=19,i.f(),t.finish(19);case 22:return t.abrupt("return",o);case 23:case"end":return t.stop()}}),t,null,[[5,16,19,22]])})));return function(e,r){return t.apply(this,arguments)}}()),_defineProperty(_assertThisInitialized(e),"call",(function(t,r){var n=e.get(t);if(n){var o,a=_createForOfIteratorHelper(n);try{for(a.s();!(o=a.n()).done;){var i=_slicedToArray(o.value,2),c=i[0],u=i[1];c.call(r,u)}}catch(e){a.e(e)}finally{a.f()}}})),_defineProperty(_assertThisInitialized(e),"callWaterFall",(function(t,r){var n=r,o=e.get(t);if(!o)return n;var a,i=_createForOfIteratorHelper(o);try{for(i.s();!(a=i.n()).done;){var c=_slicedToArray(a.value,2),u=c[0],s=c[1];n=u.call(s,n)}}catch(e){i.e(e)}finally{i.f()}return n})),e}return r}();exports.Events=Events,exports.Hooks=Hooks,exports.default=Events;
"use strict";function asyncGeneratorStep(e,t,r,n,o,a,i){try{var u=e[a](i),c=u.value}catch(e){return void r(e)}u.done?t(c):Promise.resolve(c).then(n,o)}function _asyncToGenerator(e){return function(){var t=this,r=arguments;return new Promise((function(n,o){var a=e.apply(t,r);function i(e){asyncGeneratorStep(a,n,o,i,u,"next",e)}function u(e){asyncGeneratorStep(a,n,o,i,u,"throw",e)}i(void 0)}))}}function _classCallCheck(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function _defineProperty(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function _inherits(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&&_setPrototypeOf(e,t)}function _getPrototypeOf(e){return(_getPrototypeOf=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function _setPrototypeOf(e,t){return(_setPrototypeOf=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function _isNativeReflectConstruct(){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 _construct(e,t,r){return(_construct=_isNativeReflectConstruct()?Reflect.construct:function(e,t,r){var n=[null];n.push.apply(n,t);var o=new(Function.bind.apply(e,n));return r&&_setPrototypeOf(o,r.prototype),o}).apply(null,arguments)}function _isNativeFunction(e){return-1!==Function.toString.call(e).indexOf("[native code]")}function _wrapNativeSuper(e){var t="function"==typeof Map?new Map:void 0;return(_wrapNativeSuper=function(e){if(null===e||!_isNativeFunction(e))return e;if("function"!=typeof e)throw new TypeError("Super expression must either be null or a function");if(void 0!==t){if(t.has(e))return t.get(e);t.set(e,r)}function r(){return _construct(e,arguments,_getPrototypeOf(this).constructor)}return r.prototype=Object.create(e.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),_setPrototypeOf(r,e)})(e)}function _assertThisInitialized(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function _possibleConstructorReturn(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?_assertThisInitialized(e):t}function _createSuper(e){var t=_isNativeReflectConstruct();return function(){var r,n=_getPrototypeOf(e);if(t){var o=_getPrototypeOf(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return _possibleConstructorReturn(this,r)}}function _slicedToArray(e,t){return _arrayWithHoles(e)||_iterableToArrayLimit(e,t)||_unsupportedIterableToArray(e,t)||_nonIterableRest()}function _arrayWithHoles(e){if(Array.isArray(e))return e}function _iterableToArrayLimit(e,t){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e)){var r=[],n=!0,o=!1,a=void 0;try{for(var i,u=e[Symbol.iterator]();!(n=(i=u.next()).done)&&(r.push(i.value),!t||r.length!==t);n=!0);}catch(e){o=!0,a=e}finally{try{n||null==u.return||u.return()}finally{if(o)throw a}}return r}}function _unsupportedIterableToArray(e,t){if(e){if("string"==typeof e)return _arrayLikeToArray(e,t);var r=Object.prototype.toString.call(e).slice(8,-1);return"Object"===r&&e.constructor&&(r=e.constructor.name),"Map"===r||"Set"===r?Array.from(e):"Arguments"===r||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(r)?_arrayLikeToArray(e,t):void 0}}function _arrayLikeToArray(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function _nonIterableRest(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}function _createForOfIteratorHelper(e,t){var r;if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(r=_unsupportedIterableToArray(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,o=function(){};return{s:o,n:function(){return n>=e.length?{done:!0}:{done:!1,value:e[n++]}},e:function(e){throw e},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return i=e.done,e},e:function(e){u=!0,a=e},f:function(){try{i||null==r.return||r.return()}finally{if(u)throw a}}}}Object.defineProperty(exports,"__esModule",{value:!0});var Events=function(e){_inherits(r,_wrapNativeSuper(Map));var t=_createSuper(r);function r(){var e;return _classCallCheck(this,r),_defineProperty(_assertThisInitialized(e=t.call(this)),"on",(function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("function"!=typeof r)throw new TypeError("Event Listener must be a function");var o=e.get(t)||[];return o.push([r,n]),e.set(t,o),function(){var n=e.get(t)||[];e.set(t,n.filter((function(e){return e[0]!==r})))}})),_defineProperty(_assertThisInitialized(e),"emit",(function(t){for(var r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];var a="*"===t?[]:e.get("*")||[],i=(e.get(t)||[]).concat(a);i.forEach((function(e){var t=_slicedToArray(e,2),r=t[0],o=t[1];r.apply(o,n)}))})),_defineProperty(_assertThisInitialized(e),"unbindAll",(function(t){t?e.delete(t):e.clear()})),Object.freeze(_assertThisInitialized(e)),e}return r}(),Hooks=function(e){_inherits(r,_wrapNativeSuper(Map));var t=_createSuper(r);function r(){var e;return _classCallCheck(this,r),_defineProperty(_assertThisInitialized(e=t.call(this)),"tap",(function(t,r){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("function"!=typeof r)throw new TypeError("Callback must be a function");var o=e.get(t)||[];return o.push([r,n]),e.set(t,o),function(){var n=e.get(t)||[];e.set(t,n.filter((function(e){return e[0]!==r})))}})),_defineProperty(_assertThisInitialized(e),"callAsync",function(){var t=_asyncToGenerator(regeneratorRuntime.mark((function t(r){var n,o,a,i,u,c,s,f,l,p=arguments;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.get(r)){t.next=3;break}return t.abrupt("return");case 3:for(o=p.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=p[i];u=_createForOfIteratorHelper(n),t.prev=5,u.s();case 7:if((c=u.n()).done){t.next=13;break}return s=_slicedToArray(c.value,2),f=s[0],l=s[1],t.next=11,f.apply(l,a);case 11:t.next=7;break;case 13:t.next=18;break;case 15:t.prev=15,t.t0=t.catch(5),u.e(t.t0);case 18:return t.prev=18,u.f(),t.finish(18);case 21:case"end":return t.stop()}}),t,null,[[5,15,18,21]])})));return function(e){return t.apply(this,arguments)}}()),_defineProperty(_assertThisInitialized(e),"callAsyncWaterFall",function(){var t=_asyncToGenerator(regeneratorRuntime.mark((function t(r,n){var o,a,i,u,c,s,f;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o=n,a=e.get(r)){t.next=4;break}return t.abrupt("return",o);case 4:i=_createForOfIteratorHelper(a),t.prev=5,i.s();case 7:if((u=i.n()).done){t.next=14;break}return c=_slicedToArray(u.value,2),s=c[0],f=c[1],t.next=11,s.call(f,o);case 11:o=t.sent;case 12:t.next=7;break;case 14:t.next=19;break;case 16:t.prev=16,t.t0=t.catch(5),i.e(t.t0);case 19:return t.prev=19,i.f(),t.finish(19);case 22:return t.abrupt("return",o);case 23:case"end":return t.stop()}}),t,null,[[5,16,19,22]])})));return function(e,r){return t.apply(this,arguments)}}()),_defineProperty(_assertThisInitialized(e),"call",(function(t,r){var n=e.get(t);if(n){var o,a=_createForOfIteratorHelper(n);try{for(a.s();!(o=a.n()).done;){var i=_slicedToArray(o.value,2),u=i[0],c=i[1];u.call(r,c)}}catch(e){a.e(e)}finally{a.f()}}})),_defineProperty(_assertThisInitialized(e),"callWaterFall",(function(t,r){var n=r,o=e.get(t);if(!o)return n;var a,i=_createForOfIteratorHelper(o);try{for(i.s();!(a=i.n()).done;){var u=_slicedToArray(a.value,2),c=u[0],s=u[1];n=c.call(s,n)}}catch(e){i.e(e)}finally{i.f()}return n})),Object.freeze(_assertThisInitialized(e)),e}return r}();exports.Events=Events,exports.Hooks=Hooks,exports.default=Events;
//# sourceMappingURL=capillaries.min.js.map
/*!
* @module capillaries
* @description Javascript Events
* @version 3.0.2
* @version 3.1.0
* @link https://github.com/sibiraj-s/capillaries.git

@@ -319,97 +319,72 @@ * @licence MIT License, https://opensource.org/licenses/MIT

function _classPrivateFieldGet(receiver, privateMap) {
var descriptor = privateMap.get(receiver);
var Events = /*#__PURE__*/function (_Map) {
_inherits(Events, _Map);
if (!descriptor) {
throw new TypeError("attempted to get private field on non-instance");
}
var _super = _createSuper(Events);
if (descriptor.get) {
return descriptor.get.call(receiver);
}
function Events() {
var _this;
return descriptor.value;
}
_classCallCheck(this, Events);
function _classPrivateFieldSet(receiver, privateMap, value) {
var descriptor = privateMap.get(receiver);
_this = _super.call(this);
if (!descriptor) {
throw new TypeError("attempted to set private field on non-instance");
}
_defineProperty(_assertThisInitialized(_this), "on", function (type, listener) {
var ctx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
if (descriptor.set) {
descriptor.set.call(receiver, value);
} else {
if (!descriptor.writable) {
throw new TypeError("attempted to set read only private field");
}
if (typeof listener !== 'function') {
throw new TypeError('Event Listener must be a function');
}
descriptor.value = value;
}
var event = _this.get(type) || [];
event.push([listener, ctx]);
return value;
}
_this.set(type, event);
var _events = new WeakMap();
return function () {
var events = _this.get(type) || [];
var Events = function Events() {
var _this = this;
_this.set(type, events.filter(function (e) {
return e[0] !== listener;
}));
};
});
_classCallCheck(this, Events);
_defineProperty(_assertThisInitialized(_this), "emit", function (type) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
_events.set(this, {
writable: true,
value: {}
});
var starEvents = type === '*' ? [] : _this.get('*') || [];
var eventList = (_this.get(type) || []).concat(starEvents);
eventList.forEach(function (event) {
var _event = _slicedToArray(event, 2),
listenerFn = _event[0],
ctx = _event[1];
_defineProperty(this, "on", function (type, listener) {
var ctx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;
if (typeof listener !== 'function') {
throw new TypeError('Event Listener must be a function');
}
var event = _classPrivateFieldGet(_this, _events)[type] || [];
event.push([listener, ctx]);
_classPrivateFieldGet(_this, _events)[type] = event;
return function () {
_classPrivateFieldGet(_this, _events)[type] = (_classPrivateFieldGet(_this, _events)[type] || []).filter(function (e) {
return e[0] !== listener;
listenerFn.apply(ctx, args);
});
};
});
});
_defineProperty(this, "emit", function (type) {
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {
args[_key - 1] = arguments[_key];
}
_defineProperty(_assertThisInitialized(_this), "unbindAll", function (type) {
if (type) {
_this["delete"](type);
var starEvents = type === '*' ? [] : _classPrivateFieldGet(_this, _events)['*'] || [];
var eventList = (_classPrivateFieldGet(_this, _events)[type] || []).concat(starEvents);
eventList.forEach(function (event) {
var _event = _slicedToArray(event, 2),
listenerFn = _event[0],
ctx = _event[1];
return;
}
listenerFn.apply(ctx, args);
_this.clear();
});
});
_defineProperty(this, "unbindAll", function (type) {
if (type) {
delete _classPrivateFieldGet(_this, _events)[type];
return;
}
Object.freeze(_assertThisInitialized(_this));
return _this;
}
_classPrivateFieldSet(_this, _events, {});
});
return Events;
}( /*#__PURE__*/_wrapNativeSuper(Map));
var Hooks = /*#__PURE__*/function (_Map2) {
_inherits(Hooks, _Map2);
Object.freeze(this);
};
var Hooks = /*#__PURE__*/function (_Map) {
_inherits(Hooks, _Map);
var _super2 = _createSuper(Hooks);
var _super = _createSuper(Hooks);
function Hooks() {

@@ -420,8 +395,4 @@ var _this2;

for (var _len2 = arguments.length, _args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
_args[_key2] = arguments[_key2];
}
_this2 = _super2.call(this);
_this2 = _super.call.apply(_super, [this].concat(_args));
_defineProperty(_assertThisInitialized(_this2), "tap", function (name, cb) {

@@ -440,3 +411,3 @@ var ctx = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : null;

return function () {
var hooks = _this2.get(name);
var hooks = _this2.get(name) || [];

@@ -452,5 +423,5 @@ _this2.set(name, hooks.filter(function (e) {

var hooks,
_len3,
_len2,
args,
_key3,
_key2,
_iterator,

@@ -461,3 +432,3 @@ _step,

ctx,
_args2 = arguments;
_args = arguments;

@@ -478,4 +449,4 @@ return regeneratorRuntime.wrap(function _callee$(_context) {

case 3:
for (_len3 = _args2.length, args = new Array(_len3 > 1 ? _len3 - 1 : 0), _key3 = 1; _key3 < _len3; _key3++) {
args[_key3 - 1] = _args2[_key3];
for (_len2 = _args.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {
args[_key2 - 1] = _args[_key2];
}

@@ -660,2 +631,3 @@

Object.freeze(_assertThisInitialized(_this2));
return _this2;

@@ -662,0 +634,0 @@ }

/*!
* @module capillaries
* @description Javascript Events
* @version 3.0.2
* @version 3.1.0
* @link https://github.com/sibiraj-s/capillaries.git
* @licence MIT License, https://opensource.org/licenses/MIT
*/
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Capillaries={})}(this,(function(t){"use strict";function e(t,e,n,r,o,a,i){try{var u=t[a](i),c=u.value}catch(t){return void n(t)}u.done?e(c):Promise.resolve(c).then(r,o)}function n(t){return function(){var n=this,r=arguments;return new Promise((function(o,a){var i=t.apply(n,r);function u(t){e(i,o,a,u,c,"next",t)}function c(t){e(i,o,a,u,c,"throw",t)}u(void 0)}))}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}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(t){return!1}}function c(t,e,n){return(c=u()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&i(o,n.prototype),o}).apply(null,arguments)}function f(t){var e="function"==typeof Map?new Map:void 0;return(f=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return c(t,arguments,a(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),i(r,t)})(t)}function l(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function s(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?l(t):e}function p(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,o=!1,a=void 0;try{for(var i,u=t[Symbol.iterator]();!(r=(i=u.next()).done)&&(n.push(i.value),!e||n.length!==e);r=!0);}catch(t){o=!0,a=t}finally{try{r||null==u.return||u.return()}finally{if(o)throw a}}return n}(t,e)||y(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function y(t,e){if(t){if("string"==typeof t)return v(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?v(t,e):void 0}}function v(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function h(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=y(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var a,i=!0,u=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return i=t.done,t},e:function(t){u=!0,a=t},f:function(){try{i||null==n.return||n.return()}finally{if(u)throw a}}}}function b(t,e){var n=e.get(t);if(!n)throw new TypeError("attempted to get private field on non-instance");return n.get?n.get.call(t):n.value}var d=new WeakMap,w=function t(){var e=this;r(this,t),d.set(this,{writable:!0,value:{}}),o(this,"on",(function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("function"!=typeof n)throw new TypeError("Event Listener must be a function");var o=b(e,d)[t]||[];return o.push([n,r]),b(e,d)[t]=o,function(){b(e,d)[t]=(b(e,d)[t]||[]).filter((function(t){return t[0]!==n}))}})),o(this,"emit",(function(t){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var a="*"===t?[]:b(e,d)["*"]||[],i=(b(e,d)[t]||[]).concat(a);i.forEach((function(t){var e=p(t,2),n=e[0],o=e[1];n.apply(o,r)}))})),o(this,"unbindAll",(function(t){t?delete b(e,d)[t]:function(t,e,n){var r=e.get(t);if(!r)throw new TypeError("attempted to set private field on non-instance");if(r.set)r.set.call(t,n);else{if(!r.writable)throw new TypeError("attempted to set read only private field");r.value=n}}(e,d,{})})),Object.freeze(this)},m=function(t){!function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e)}(y,t);var e,c,f=(e=y,c=u(),function(){var t,n=a(e);if(c){var r=a(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return s(this,t)});function y(){var t;r(this,y);for(var e=arguments.length,a=new Array(e),i=0;i<e;i++)a[i]=arguments[i];return o(l(t=f.call.apply(f,[this].concat(a))),"tap",(function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("function"!=typeof n)throw new TypeError("Callback must be a function");var o=t.get(e)||[];return o.push([n,r]),t.set(e,o),function(){var r=t.get(e);t.set(e,r.filter((function(t){return t[0]!==n})))}})),o(l(t),"callAsync",function(){var e=n(regeneratorRuntime.mark((function e(n){var r,o,a,i,u,c,f,l,s,y=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.get(n)){e.next=3;break}return e.abrupt("return");case 3:for(o=y.length,a=new Array(o>1?o-1:0),i=1;i<o;i++)a[i-1]=y[i];u=h(r),e.prev=5,u.s();case 7:if((c=u.n()).done){e.next=13;break}return f=p(c.value,2),l=f[0],s=f[1],e.next=11,l.apply(s,a);case 11:e.next=7;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(5),u.e(e.t0);case 18:return e.prev=18,u.f(),e.finish(18);case 21:case"end":return e.stop()}}),e,null,[[5,15,18,21]])})));return function(t){return e.apply(this,arguments)}}()),o(l(t),"callAsyncWaterFall",function(){var e=n(regeneratorRuntime.mark((function e(n,r){var o,a,i,u,c,f,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=r,a=t.get(n)){e.next=4;break}return e.abrupt("return",o);case 4:i=h(a),e.prev=5,i.s();case 7:if((u=i.n()).done){e.next=14;break}return c=p(u.value,2),f=c[0],l=c[1],e.next=11,f.call(l,o);case 11:o=e.sent;case 12:e.next=7;break;case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(5),i.e(e.t0);case 19:return e.prev=19,i.f(),e.finish(19);case 22:return e.abrupt("return",o);case 23:case"end":return e.stop()}}),e,null,[[5,16,19,22]])})));return function(t,n){return e.apply(this,arguments)}}()),o(l(t),"call",(function(e,n){var r=t.get(e);if(r){var o,a=h(r);try{for(a.s();!(o=a.n()).done;){var i=p(o.value,2),u=i[0],c=i[1];u.call(n,c)}}catch(t){a.e(t)}finally{a.f()}}})),o(l(t),"callWaterFall",(function(e,n){var r=n,o=t.get(e);if(!o)return r;var a,i=h(o);try{for(i.s();!(a=i.n()).done;){var u=p(a.value,2),c=u[0],f=u[1];r=c.call(f,r)}}catch(t){i.e(t)}finally{i.f()}return r})),t}return y}(f(Map));t.Events=w,t.Hooks=m,t.default=w,Object.defineProperty(t,"__esModule",{value:!0})}));
!function(t,e){"object"==typeof exports&&"undefined"!=typeof module?e(exports):"function"==typeof define&&define.amd?define(["exports"],e):e((t="undefined"!=typeof globalThis?globalThis:t||self).Capillaries={})}(this,(function(t){"use strict";function e(t,e,n,r,o,u,a){try{var i=t[u](a),c=i.value}catch(t){return void n(t)}i.done?e(c):Promise.resolve(c).then(r,o)}function n(t){return function(){var n=this,r=arguments;return new Promise((function(o,u){var a=t.apply(n,r);function i(t){e(a,o,u,i,c,"next",t)}function c(t){e(a,o,u,i,c,"throw",t)}i(void 0)}))}}function r(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function o(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function u(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&i(t,e)}function a(t){return(a=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function i(t,e){return(i=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function c(){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(t){return!1}}function f(t,e,n){return(f=c()?Reflect.construct:function(t,e,n){var r=[null];r.push.apply(r,e);var o=new(Function.bind.apply(t,r));return n&&i(o,n.prototype),o}).apply(null,arguments)}function l(t){var e="function"==typeof Map?new Map:void 0;return(l=function(t){if(null===t||(n=t,-1===Function.toString.call(n).indexOf("[native code]")))return t;var n;if("function"!=typeof t)throw new TypeError("Super expression must either be null or a function");if(void 0!==e){if(e.has(t))return e.get(t);e.set(t,r)}function r(){return f(t,arguments,a(this).constructor)}return r.prototype=Object.create(t.prototype,{constructor:{value:r,enumerable:!1,writable:!0,configurable:!0}}),i(r,t)})(t)}function s(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function p(t,e){return!e||"object"!=typeof e&&"function"!=typeof e?s(t):e}function y(t){var e=c();return function(){var n,r=a(t);if(e){var o=a(this).constructor;n=Reflect.construct(r,arguments,o)}else n=r.apply(this,arguments);return p(this,n)}}function v(t,e){return function(t){if(Array.isArray(t))return t}(t)||function(t,e){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(t)))return;var n=[],r=!0,o=!1,u=void 0;try{for(var a,i=t[Symbol.iterator]();!(r=(a=i.next()).done)&&(n.push(a.value),!e||n.length!==e);r=!0);}catch(t){o=!0,u=t}finally{try{r||null==i.return||i.return()}finally{if(o)throw u}}return n}(t,e)||h(t,e)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function h(t,e){if(t){if("string"==typeof t)return b(t,e);var n=Object.prototype.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?b(t,e):void 0}}function b(t,e){(null==e||e>t.length)&&(e=t.length);for(var n=0,r=new Array(e);n<e;n++)r[n]=t[n];return r}function d(t,e){var n;if("undefined"==typeof Symbol||null==t[Symbol.iterator]){if(Array.isArray(t)||(n=h(t))||e&&t&&"number"==typeof t.length){n&&(t=n);var r=0,o=function(){};return{s:o,n:function(){return r>=t.length?{done:!0}:{done:!1,value:t[r++]}},e:function(t){throw t},f:o}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var u,a=!0,i=!1;return{s:function(){n=t[Symbol.iterator]()},n:function(){var t=n.next();return a=t.done,t},e:function(t){i=!0,u=t},f:function(){try{a||null==n.return||n.return()}finally{if(i)throw u}}}}var m=function(t){u(n,t);var e=y(n);function n(){var t;return r(this,n),o(s(t=e.call(this)),"on",(function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("function"!=typeof n)throw new TypeError("Event Listener must be a function");var o=t.get(e)||[];return o.push([n,r]),t.set(e,o),function(){var r=t.get(e)||[];t.set(e,r.filter((function(t){return t[0]!==n})))}})),o(s(t),"emit",(function(e){for(var n=arguments.length,r=new Array(n>1?n-1:0),o=1;o<n;o++)r[o-1]=arguments[o];var u="*"===e?[]:t.get("*")||[],a=(t.get(e)||[]).concat(u);a.forEach((function(t){var e=v(t,2),n=e[0],o=e[1];n.apply(o,r)}))})),o(s(t),"unbindAll",(function(e){e?t.delete(e):t.clear()})),Object.freeze(s(t)),t}return n}(l(Map)),g=function(t){u(a,t);var e=y(a);function a(){var t;return r(this,a),o(s(t=e.call(this)),"tap",(function(e,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:null;if("function"!=typeof n)throw new TypeError("Callback must be a function");var o=t.get(e)||[];return o.push([n,r]),t.set(e,o),function(){var r=t.get(e)||[];t.set(e,r.filter((function(t){return t[0]!==n})))}})),o(s(t),"callAsync",function(){var e=n(regeneratorRuntime.mark((function e(n){var r,o,u,a,i,c,f,l,s,p=arguments;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.get(n)){e.next=3;break}return e.abrupt("return");case 3:for(o=p.length,u=new Array(o>1?o-1:0),a=1;a<o;a++)u[a-1]=p[a];i=d(r),e.prev=5,i.s();case 7:if((c=i.n()).done){e.next=13;break}return f=v(c.value,2),l=f[0],s=f[1],e.next=11,l.apply(s,u);case 11:e.next=7;break;case 13:e.next=18;break;case 15:e.prev=15,e.t0=e.catch(5),i.e(e.t0);case 18:return e.prev=18,i.f(),e.finish(18);case 21:case"end":return e.stop()}}),e,null,[[5,15,18,21]])})));return function(t){return e.apply(this,arguments)}}()),o(s(t),"callAsyncWaterFall",function(){var e=n(regeneratorRuntime.mark((function e(n,r){var o,u,a,i,c,f,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=r,u=t.get(n)){e.next=4;break}return e.abrupt("return",o);case 4:a=d(u),e.prev=5,a.s();case 7:if((i=a.n()).done){e.next=14;break}return c=v(i.value,2),f=c[0],l=c[1],e.next=11,f.call(l,o);case 11:o=e.sent;case 12:e.next=7;break;case 14:e.next=19;break;case 16:e.prev=16,e.t0=e.catch(5),a.e(e.t0);case 19:return e.prev=19,a.f(),e.finish(19);case 22:return e.abrupt("return",o);case 23:case"end":return e.stop()}}),e,null,[[5,16,19,22]])})));return function(t,n){return e.apply(this,arguments)}}()),o(s(t),"call",(function(e,n){var r=t.get(e);if(r){var o,u=d(r);try{for(u.s();!(o=u.n()).done;){var a=v(o.value,2),i=a[0],c=a[1];i.call(n,c)}}catch(t){u.e(t)}finally{u.f()}}})),o(s(t),"callWaterFall",(function(e,n){var r=n,o=t.get(e);if(!o)return r;var u,a=d(o);try{for(a.s();!(u=a.n()).done;){var i=v(u.value,2),c=i[0],f=i[1];r=c.call(f,r)}}catch(t){a.e(t)}finally{a.f()}return r})),Object.freeze(s(t)),t}return a}(l(Map));t.Events=m,t.Hooks=g,t.default=m,Object.defineProperty(t,"__esModule",{value:!0})}));
//# sourceMappingURL=capillaries.umd.min.js.map

@@ -17,2 +17,8 @@ # CHANGELOG

## v3.1.0 (2021-01-07)
#### Enhancements
- event class extends `Map` ([6944261](https://github.com/sibiraj-s/capillaries/commit/6944261))
## v3.0.2 (2021-01-07)

@@ -19,0 +25,0 @@

{
"name": "capillaries",
"version": "3.0.2",
"version": "3.1.0",
"description": "Javascript Events",

@@ -5,0 +5,0 @@ "author": "sibiraj-s",

@@ -19,16 +19,2 @@ # Capillaries [![Tests](https://github.com/sibiraj-s/capillaries/workflows/Tests/badge.svg)](https://github.com/sibiraj-s/capillaries/actions)

or use cdn
#### Minified:
```bash
//cdn.jsdelivr.net/npm/capillaries@latest/capillaries.umd.min.js
```
#### Pretty Printed:
```bash
//cdn.jsdelivr.net/npm/capillaries@latest/capillaries.umd.js
```
### Events

@@ -61,2 +47,4 @@

event.unbindAll();
// or
event.clear();
```

@@ -85,2 +73,5 @@

hooks.callAsyncWaterFall('AsyncHook', payload); // awaits on taps, returns 'Hello World!'
// remove all hooks
hooks.clear()
```

@@ -92,8 +83,8 @@

- Internet Explorer 9+
- Chrome 6+
- Chrome 38+
- Edge 12+
- Firefox 4+
- Opera 12+
- Safari 5.1+
- Firefox 13+
- Opera 25+
- Safari 8+
- Internet Explorer 11

@@ -100,0 +91,0 @@ [npm]: https://www.npmjs.com/

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

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc