From 298d4906ebb81bf6665111c0f03dc8db77ff92c7 Mon Sep 17 00:00:00 2001 From: Cory Robinson Date: Thu, 20 Jul 2017 10:42:54 -0700 Subject: [PATCH] fix(): remove babel Runtime transform plugin from build step for ie11 bug --- build.js | 2 +- build.js.map | 2 +- src/.babelrc | 1 - 3 files changed, 2 insertions(+), 3 deletions(-) diff --git a/build.js b/build.js index 4607e7c..0081157 100644 --- a/build.js +++ b/build.js @@ -1,2 +1,2 @@ -!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.EventSky=n()}(this,function(){"use strict";function e(e){return e&&e.__esModule?e.default:e}function n(e,n){return n={exports:{}},e(n,n.exports),n.exports}var t=function(e){if(void 0==e)throw TypeError("Can't call method on "+e);return e},r=function(e){return Object(t(e))},o={}.hasOwnProperty,i=function(e,n){return o.call(e,n)},u={}.toString,a=function(e){return u.call(e).slice(8,-1)},c=Object("z").propertyIsEnumerable(0)?Object:function(e){return"String"==a(e)?e.split(""):Object(e)},f=function(e){return c(t(e))},s=Math.ceil,l=Math.floor,h=function(e){return isNaN(e=+e)?0:(e>0?l:s)(e)},d=Math.min,v=function(e){return e>0?d(h(e),9007199254740991):0},p=Math.max,y=Math.min,_=function(e,n){return e=h(e),e<0?p(e+n,0):y(e,n)},b=n(function(e){var n=e.exports="undefined"!=typeof window&&window.Math==Math?window:"undefined"!=typeof self&&self.Math==Math?self:Function("return this")();"number"==typeof __g&&(__g=n)}),g=b["__core-js_shared__"]||(b["__core-js_shared__"]={}),E=0,m=Math.random(),w=function(e){return"Symbol(".concat(void 0===e?"":e,")_",(++E+m).toString(36))},S=function(e){return g[e]||(g[e]={})}("keys"),O=function(e){return function(n,t,r){var o,i=f(n),u=v(i.length),a=_(r,u);if(e&&t!=t){for(;u>a;)if((o=i[a++])!=o)return!0}else for(;u>a;a++)if((e||a in i)&&i[a]===t)return e||a||0;return!e&&-1}}(!1),k=function(e){return S[e]||(S[e]=w(e))}("IE_PROTO"),j=function(e,n){var t,r=f(e),o=0,u=[];for(t in r)t!=k&&i(r,t)&&u.push(t);for(;n.length>o;)i(r,t=n[o++])&&(~O(u,t)||u.push(t));return u},M="constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf".split(","),x=Object.keys||function(e){return j(e,M)},A=n(function(e){var n=e.exports={version:"2.4.0"};"number"==typeof __e&&(__e=n)}),P=function(e){if("function"!=typeof e)throw TypeError(e+" is not a function!");return e},F=function(e,n,t){if(P(e),void 0===n)return e;switch(t){case 1:return function(t){return e.call(n,t)};case 2:return function(t,r){return e.call(n,t,r)};case 3:return function(t,r,o){return e.call(n,t,r,o)}}return function(){return e.apply(n,arguments)}},H=function(e){return"object"==typeof e?null!==e:"function"==typeof e},I=function(e){if(!H(e))throw TypeError(e+" is not an object!");return e},N=function(e){try{return!!e()}catch(e){return!0}},T=!N(function(){return 7!=Object.defineProperty({},"a",{get:function(){return 7}}).a}),W=b.document,C=H(W)&&H(W.createElement),R=function(e){return C?W.createElement(e):{}},B=!T&&!N(function(){return 7!=Object.defineProperty(R("div"),"a",{get:function(){return 7}}).a}),D=function(e,n){if(!H(e))return e;var t,r;if(n&&"function"==typeof(t=e.toString)&&!H(r=t.call(e)))return r;if("function"==typeof(t=e.valueOf)&&!H(r=t.call(e)))return r;if(!n&&"function"==typeof(t=e.toString)&&!H(r=t.call(e)))return r;throw TypeError("Can't convert object to primitive value")},G=Object.defineProperty,z=T?Object.defineProperty:function(e,n,t){if(I(e),n=D(n,!0),I(t),B)try{return G(e,n,t)}catch(e){}if("get"in t||"set"in t)throw TypeError("Accessors not supported!");return"value"in t&&(e[n]=t.value),e},L={f:z},U=function(e,n){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:n}},q=T?function(e,n,t){return L.f(e,n,U(1,t))}:function(e,n,t){return e[n]=t,e},J=function(e,n,t){var r,o,i,u=e&J.F,a=e&J.G,c=e&J.S,f=e&J.P,s=e&J.B,l=e&J.W,h=a?A:A[n]||(A[n]={}),d=h.prototype,v=a?b:c?b[n]:(b[n]||{}).prototype;a&&(t=n);for(r in t)(o=!u&&v&&void 0!==v[r])&&r in h||(i=o?v[r]:t[r],h[r]=a&&"function"!=typeof v[r]?t[r]:s&&o?F(i,b):l&&v[r]==i?function(e){var n=function(n,t,r){if(this instanceof e){switch(arguments.length){case 0:return new e;case 1:return new e(n);case 2:return new e(n,t)}return new e(n,t,r)}return e.apply(this,arguments)};return n.prototype=e.prototype,n}(i):f&&"function"==typeof i?F(Function.call,i):i,f&&((h.virtual||(h.virtual={}))[r]=i,e&J.R&&d&&!d[r]&&q(d,r,i)))};J.F=1,J.G=2,J.S=4,J.P=8,J.B=16,J.W=32,J.U=64,J.R=128;var K=J;!function(e,n){var t=(A.Object||{})[e]||Object[e],r={};r[e]=n(t),K(K.S+K.F*N(function(){t(1)}),"Object",r)}("keys",function(){return function(e){return x(r(e))}});var Q=A.Object.keys,V=n(function(e){e.exports={default:Q,__esModule:!0}}),X=e(V),Y=n(function(e,n){n.__esModule=!0,n.default=function(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}}),Z=e(Y);K(K.S+K.F*!T,"Object",{defineProperty:L.f});var $=A.Object,ee=function(e,n,t){return $.defineProperty(e,n,t)},ne=n(function(e){e.exports={default:ee,__esModule:!0}}),te=n(function(e,n){n.__esModule=!0;var t=function(e){return e&&e.__esModule?e:{default:e}}(ne);n.default=function(){function e(e,n){for(var r=0;r> "+e):null},this.on=this._utils.curryWhenHandler.bind(this)("on"),this.once=this._utils.curryWhenHandler.bind(this)("once"),this.beforeAll=this._utils.curryWhenHandler.bind(this)("beforeAll"),this.afterAll=this._utils.curryWhenHandler.bind(this)("afterAll"),this.off.all=this.allOff.bind(this)}return re(e,[{key:"off",value:function(e,n){var t=this;return X(this.events).forEach(function(r){X(t.events[r]).forEach(function(o){["beforeAll","on","once","afterAll"].includes(o)&&X(t.events[r][o]).forEach(function(i){var u=t.events[r][o][i]===n&&r===e,a=!n&&i===e;(u||a)&&(delete t.events[r][o][i],t.events[r].handlers--)})})}),this}},{key:"allOff",value:function(e){return delete this.events[e],this._firehose('.off.all("'+e+'") removed all event handlers'),this.events[e]=this._utils.createNewEventMap(),this}},{key:"trigger",value:function(e,n){if(!this._utils.validateEventName(this,e))return this;if(!this.events[e])return this._firehose('"'+e+'" triggered with no handlers setup'),this;this._firehose('"'+e+'" triggered');var t=this.events[e].beforeAll;X(t).forEach(function(o){try{t[o](n)}catch(i){t[o]?console.error("EventSky error: .beforeAll('"+e+"', "+(r[o].name||"anonymous")+") handler trapped an error",{error:i,data:n}):console.error("EventSky error: .beforeAll('"+e+"', ...) handler does not exist",{eventId:o,data:n})}});var r=this.events[e].on;X(r).forEach(function(t){try{r[t](n)}catch(o){r[t]?console.error("EventSky error: .on('"+e+"', "+(r[t].name||"anonymous")+") handler trapped an error",{error:o,data:n}):console.error("EventSky error: .on('"+e+"', ...) handler does not exist",{eventId:t,data:n})}});var o=this.events[e].once;X(o).forEach(function(t){try{o[t](n)}catch(i){o[t]?console.error("EventSky error: .once('"+e+"', "+(r[t].name||"anonymous")+") handler trapped an error",{error:i,data:n}):console.error("EventSky error: .once('"+e+"', ...) handler does not exist",{eventId:t,data:n})}});var i=this.events[e].afterAll;return X(i).forEach(function(t){try{i[t](n)}catch(o){i[t]?console.error("EventSky error: .afterAll('"+e+"', "+(r[t].name||"anonymous")+") handler trapped an error",{error:o,data:n}):console.error("EventSky error: .afterAll('"+e+"', ...) handler does not exist",{eventId:t,data:n})}}),this}}]),e}())}); +!function(e,n){"object"==typeof exports&&"undefined"!=typeof module?module.exports=n():"function"==typeof define&&define.amd?define(n):e.EventSky=n()}(this,function(){"use strict";function e(e,n){if(!(e instanceof n))throw new TypeError("Cannot call a class as a function")}var n={createNewEventMap:function(e){return{handlers:0,_handlers:0,_name:e,on:{},once:{},beforeAll:{},afterAll:{}}},curryWhenHandler:function(e){var n=this;return function(r,t){if("string"!=typeof r||r.length<1||"function"!=typeof t)return console.warn('EventSky warning: "'+r+'" event must be a string and handler must be a function - not set with .'+e+" handler"),n;n.events[r]||(n.events[r]=n._utils.createNewEventMap(r)),n.events[r][e]&&n.events[r][e]===t&&(n.config.ignoreDuplicateHandler||console.warn("EventSky warning: duplicate handler for ."+e+"('"+r+"')")),n.events[r].handlers++;var o=n.events[r]._handlers++,a="id_"+r+"."+e+"."+o;return n.events[r][e][a]=t,a}},validateEventName:function(e,n){return e?!(!n||"string"!=typeof n)||(console.error("EventSky error: .trigger(event) did not receive a string param"),!1):console.error("EventSky._utils needs to be passed a valid context param")}},r=function(){function e(e,n){for(var r=0;r> "+e):null},this.on=this._utils.curryWhenHandler.bind(this)("on"),this.once=this._utils.curryWhenHandler.bind(this)("once"),this.beforeAll=this._utils.curryWhenHandler.bind(this)("beforeAll"),this.afterAll=this._utils.curryWhenHandler.bind(this)("afterAll"),this.off.all=this.allOff.bind(this)}return r(t,[{key:"off",value:function(e,n){var r=this;return Object.keys(this.events).forEach(function(t){Object.keys(r.events[t]).forEach(function(o){["beforeAll","on","once","afterAll"].includes(o)&&Object.keys(r.events[t][o]).forEach(function(a){var s=r.events[t][o][a]===n&&t===e,i=!n&&a===e;(s||i)&&(delete r.events[t][o][a],r.events[t].handlers--)})})}),this}},{key:"allOff",value:function(e){return delete this.events[e],this._firehose('.off.all("'+e+'") removed all event handlers'),this.events[e]=this._utils.createNewEventMap(),this}},{key:"trigger",value:function(e,n){if(!this._utils.validateEventName(this,e))return this;if(!this.events[e])return this._firehose('"'+e+'" triggered with no handlers setup'),this;this._firehose('"'+e+'" triggered');var r=this.events[e].beforeAll;Object.keys(r).forEach(function(o){try{r[o](n)}catch(a){r[o]?console.error("EventSky error: .beforeAll('"+e+"', "+(t[o].name||"anonymous")+") handler trapped an error",{error:a,data:n}):console.error("EventSky error: .beforeAll('"+e+"', ...) handler does not exist",{eventId:o,data:n})}});var t=this.events[e].on;Object.keys(t).forEach(function(r){try{t[r](n)}catch(o){t[r]?console.error("EventSky error: .on('"+e+"', "+(t[r].name||"anonymous")+") handler trapped an error",{error:o,data:n}):console.error("EventSky error: .on('"+e+"', ...) handler does not exist",{eventId:r,data:n})}});var o=this.events[e].once;Object.keys(o).forEach(function(r){try{o[r](n)}catch(a){o[r]?console.error("EventSky error: .once('"+e+"', "+(t[r].name||"anonymous")+") handler trapped an error",{error:a,data:n}):console.error("EventSky error: .once('"+e+"', ...) handler does not exist",{eventId:r,data:n})}});var a=this.events[e].afterAll;return Object.keys(a).forEach(function(r){try{a[r](n)}catch(o){a[r]?console.error("EventSky error: .afterAll('"+e+"', "+(t[r].name||"anonymous")+") handler trapped an error",{error:o,data:n}):console.error("EventSky error: .afterAll('"+e+"', ...) handler does not exist",{eventId:r,data:n})}}),this}}]),t}())}); //# sourceMappingURL=build.js.map diff --git a/build.js.map b/build.js.map index 122f936..d6dd4e6 100644 --- a/build.js.map +++ b/build.js.map @@ -1 +1 @@ -{"version":3,"file":"build.js","sources":["node_modules/core-js/library/modules/_defined.js","node_modules/core-js/library/modules/_to-object.js","node_modules/core-js/library/modules/_has.js","node_modules/core-js/library/modules/_cof.js","node_modules/core-js/library/modules/_iobject.js","node_modules/core-js/library/modules/_to-iobject.js","node_modules/core-js/library/modules/_to-integer.js","node_modules/core-js/library/modules/_to-length.js","node_modules/core-js/library/modules/_to-index.js","node_modules/core-js/library/modules/_global.js","node_modules/core-js/library/modules/_shared.js","node_modules/core-js/library/modules/_uid.js","node_modules/core-js/library/modules/_shared-key.js","node_modules/core-js/library/modules/_object-keys-internal.js","node_modules/core-js/library/modules/_array-includes.js","node_modules/core-js/library/modules/_enum-bug-keys.js","node_modules/core-js/library/modules/_object-keys.js","node_modules/core-js/library/modules/_core.js","node_modules/core-js/library/modules/_a-function.js","node_modules/core-js/library/modules/_ctx.js","node_modules/core-js/library/modules/_is-object.js","node_modules/core-js/library/modules/_an-object.js","node_modules/core-js/library/modules/_fails.js","node_modules/core-js/library/modules/_descriptors.js","node_modules/core-js/library/modules/_dom-create.js","node_modules/core-js/library/modules/_ie8-dom-define.js","node_modules/core-js/library/modules/_to-primitive.js","node_modules/core-js/library/modules/_object-dp.js","node_modules/core-js/library/modules/_property-desc.js","node_modules/core-js/library/modules/_hide.js","node_modules/core-js/library/modules/_export.js","node_modules/core-js/library/modules/_object-sap.js","node_modules/core-js/library/modules/es6.object.keys.js","node_modules/core-js/library/fn/object/keys.js","node_modules/babel-runtime/core-js/object/keys.js","node_modules/babel-runtime/helpers/classCallCheck.js","node_modules/core-js/library/modules/es6.object.define-property.js","node_modules/core-js/library/fn/object/define-property.js","node_modules/babel-runtime/core-js/object/define-property.js","node_modules/babel-runtime/helpers/createClass.js","src/utils.js","src/main.js"],"sourcesContent":["// 7.2.1 RequireObjectCoercible(argument)\nmodule.exports = function(it){\n if(it == undefined)throw TypeError(\"Can't call method on \" + it);\n return it;\n};","// 7.1.13 ToObject(argument)\nvar defined = require('./_defined');\nmodule.exports = function(it){\n return Object(defined(it));\n};","var hasOwnProperty = {}.hasOwnProperty;\nmodule.exports = function(it, key){\n return hasOwnProperty.call(it, key);\n};","var toString = {}.toString;\n\nmodule.exports = function(it){\n return toString.call(it).slice(8, -1);\n};","// fallback for non-array-like ES3 and non-enumerable old V8 strings\nvar cof = require('./_cof');\nmodule.exports = Object('z').propertyIsEnumerable(0) ? Object : function(it){\n return cof(it) == 'String' ? it.split('') : Object(it);\n};","// to indexed object, toObject with fallback for non-array-like ES3 strings\nvar IObject = require('./_iobject')\n , defined = require('./_defined');\nmodule.exports = function(it){\n return IObject(defined(it));\n};","// 7.1.4 ToInteger\nvar ceil = Math.ceil\n , floor = Math.floor;\nmodule.exports = function(it){\n return isNaN(it = +it) ? 0 : (it > 0 ? floor : ceil)(it);\n};","// 7.1.15 ToLength\nvar toInteger = require('./_to-integer')\n , min = Math.min;\nmodule.exports = function(it){\n return it > 0 ? min(toInteger(it), 0x1fffffffffffff) : 0; // pow(2, 53) - 1 == 9007199254740991\n};","var toInteger = require('./_to-integer')\n , max = Math.max\n , min = Math.min;\nmodule.exports = function(index, length){\n index = toInteger(index);\n return index < 0 ? max(index + length, 0) : min(index, length);\n};","// https://github.com/zloirock/core-js/issues/86#issuecomment-115759028\nvar global = module.exports = typeof window != 'undefined' && window.Math == Math\n ? window : typeof self != 'undefined' && self.Math == Math ? self : Function('return this')();\nif(typeof __g == 'number')__g = global; // eslint-disable-line no-undef","var global = require('./_global')\n , SHARED = '__core-js_shared__'\n , store = global[SHARED] || (global[SHARED] = {});\nmodule.exports = function(key){\n return store[key] || (store[key] = {});\n};","var id = 0\n , px = Math.random();\nmodule.exports = function(key){\n return 'Symbol('.concat(key === undefined ? '' : key, ')_', (++id + px).toString(36));\n};","var shared = require('./_shared')('keys')\n , uid = require('./_uid');\nmodule.exports = function(key){\n return shared[key] || (shared[key] = uid(key));\n};","var has = require('./_has')\n , toIObject = require('./_to-iobject')\n , arrayIndexOf = require('./_array-includes')(false)\n , IE_PROTO = require('./_shared-key')('IE_PROTO');\n\nmodule.exports = function(object, names){\n var O = toIObject(object)\n , i = 0\n , result = []\n , key;\n for(key in O)if(key != IE_PROTO)has(O, key) && result.push(key);\n // Don't enum bug & hidden keys\n while(names.length > i)if(has(O, key = names[i++])){\n ~arrayIndexOf(result, key) || result.push(key);\n }\n return result;\n};","// false -> Array#indexOf\n// true -> Array#includes\nvar toIObject = require('./_to-iobject')\n , toLength = require('./_to-length')\n , toIndex = require('./_to-index');\nmodule.exports = function(IS_INCLUDES){\n return function($this, el, fromIndex){\n var O = toIObject($this)\n , length = toLength(O.length)\n , index = toIndex(fromIndex, length)\n , value;\n // Array#includes uses SameValueZero equality algorithm\n if(IS_INCLUDES && el != el)while(length > index){\n value = O[index++];\n if(value != value)return true;\n // Array#toIndex ignores holes, Array#includes - not\n } else for(;length > index; index++)if(IS_INCLUDES || index in O){\n if(O[index] === el)return IS_INCLUDES || index || 0;\n } return !IS_INCLUDES && -1;\n };\n};","// IE 8- don't enum bug keys\nmodule.exports = (\n 'constructor,hasOwnProperty,isPrototypeOf,propertyIsEnumerable,toLocaleString,toString,valueOf'\n).split(',');","// 19.1.2.14 / 15.2.3.14 Object.keys(O)\nvar $keys = require('./_object-keys-internal')\n , enumBugKeys = require('./_enum-bug-keys');\n\nmodule.exports = Object.keys || function keys(O){\n return $keys(O, enumBugKeys);\n};","var core = module.exports = {version: '2.4.0'};\nif(typeof __e == 'number')__e = core; // eslint-disable-line no-undef","module.exports = function(it){\n if(typeof it != 'function')throw TypeError(it + ' is not a function!');\n return it;\n};","// optional / simple context binding\nvar aFunction = require('./_a-function');\nmodule.exports = function(fn, that, length){\n aFunction(fn);\n if(that === undefined)return fn;\n switch(length){\n case 1: return function(a){\n return fn.call(that, a);\n };\n case 2: return function(a, b){\n return fn.call(that, a, b);\n };\n case 3: return function(a, b, c){\n return fn.call(that, a, b, c);\n };\n }\n return function(/* ...args */){\n return fn.apply(that, arguments);\n };\n};","module.exports = function(it){\n return typeof it === 'object' ? it !== null : typeof it === 'function';\n};","var isObject = require('./_is-object');\nmodule.exports = function(it){\n if(!isObject(it))throw TypeError(it + ' is not an object!');\n return it;\n};","module.exports = function(exec){\n try {\n return !!exec();\n } catch(e){\n return true;\n }\n};","// Thank's IE8 for his funny defineProperty\nmodule.exports = !require('./_fails')(function(){\n return Object.defineProperty({}, 'a', {get: function(){ return 7; }}).a != 7;\n});","var isObject = require('./_is-object')\n , document = require('./_global').document\n // in old IE typeof document.createElement is 'object'\n , is = isObject(document) && isObject(document.createElement);\nmodule.exports = function(it){\n return is ? document.createElement(it) : {};\n};","module.exports = !require('./_descriptors') && !require('./_fails')(function(){\n return Object.defineProperty(require('./_dom-create')('div'), 'a', {get: function(){ return 7; }}).a != 7;\n});","// 7.1.1 ToPrimitive(input [, PreferredType])\nvar isObject = require('./_is-object');\n// instead of the ES6 spec version, we didn't implement @@toPrimitive case\n// and the second argument - flag - preferred type is a string\nmodule.exports = function(it, S){\n if(!isObject(it))return it;\n var fn, val;\n if(S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n if(typeof (fn = it.valueOf) == 'function' && !isObject(val = fn.call(it)))return val;\n if(!S && typeof (fn = it.toString) == 'function' && !isObject(val = fn.call(it)))return val;\n throw TypeError(\"Can't convert object to primitive value\");\n};","var anObject = require('./_an-object')\n , IE8_DOM_DEFINE = require('./_ie8-dom-define')\n , toPrimitive = require('./_to-primitive')\n , dP = Object.defineProperty;\n\nexports.f = require('./_descriptors') ? Object.defineProperty : function defineProperty(O, P, Attributes){\n anObject(O);\n P = toPrimitive(P, true);\n anObject(Attributes);\n if(IE8_DOM_DEFINE)try {\n return dP(O, P, Attributes);\n } catch(e){ /* empty */ }\n if('get' in Attributes || 'set' in Attributes)throw TypeError('Accessors not supported!');\n if('value' in Attributes)O[P] = Attributes.value;\n return O;\n};","module.exports = function(bitmap, value){\n return {\n enumerable : !(bitmap & 1),\n configurable: !(bitmap & 2),\n writable : !(bitmap & 4),\n value : value\n };\n};","var dP = require('./_object-dp')\n , createDesc = require('./_property-desc');\nmodule.exports = require('./_descriptors') ? function(object, key, value){\n return dP.f(object, key, createDesc(1, value));\n} : function(object, key, value){\n object[key] = value;\n return object;\n};","var global = require('./_global')\n , core = require('./_core')\n , ctx = require('./_ctx')\n , hide = require('./_hide')\n , PROTOTYPE = 'prototype';\n\nvar $export = function(type, name, source){\n var IS_FORCED = type & $export.F\n , IS_GLOBAL = type & $export.G\n , IS_STATIC = type & $export.S\n , IS_PROTO = type & $export.P\n , IS_BIND = type & $export.B\n , IS_WRAP = type & $export.W\n , exports = IS_GLOBAL ? core : core[name] || (core[name] = {})\n , expProto = exports[PROTOTYPE]\n , target = IS_GLOBAL ? global : IS_STATIC ? global[name] : (global[name] || {})[PROTOTYPE]\n , key, own, out;\n if(IS_GLOBAL)source = name;\n for(key in source){\n // contains in native\n own = !IS_FORCED && target && target[key] !== undefined;\n if(own && key in exports)continue;\n // export native or passed\n out = own ? target[key] : source[key];\n // prevent global pollution for namespaces\n exports[key] = IS_GLOBAL && typeof target[key] != 'function' ? source[key]\n // bind timers to global for call from export context\n : IS_BIND && own ? ctx(out, global)\n // wrap global constructors for prevent change them in library\n : IS_WRAP && target[key] == out ? (function(C){\n var F = function(a, b, c){\n if(this instanceof C){\n switch(arguments.length){\n case 0: return new C;\n case 1: return new C(a);\n case 2: return new C(a, b);\n } return new C(a, b, c);\n } return C.apply(this, arguments);\n };\n F[PROTOTYPE] = C[PROTOTYPE];\n return F;\n // make static versions for prototype methods\n })(out) : IS_PROTO && typeof out == 'function' ? ctx(Function.call, out) : out;\n // export proto methods to core.%CONSTRUCTOR%.methods.%NAME%\n if(IS_PROTO){\n (exports.virtual || (exports.virtual = {}))[key] = out;\n // export proto methods to core.%CONSTRUCTOR%.prototype.%NAME%\n if(type & $export.R && expProto && !expProto[key])hide(expProto, key, out);\n }\n }\n};\n// type bitmap\n$export.F = 1; // forced\n$export.G = 2; // global\n$export.S = 4; // static\n$export.P = 8; // proto\n$export.B = 16; // bind\n$export.W = 32; // wrap\n$export.U = 64; // safe\n$export.R = 128; // real proto method for `library` \nmodule.exports = $export;","// most Object methods by ES6 should accept primitives\nvar $export = require('./_export')\n , core = require('./_core')\n , fails = require('./_fails');\nmodule.exports = function(KEY, exec){\n var fn = (core.Object || {})[KEY] || Object[KEY]\n , exp = {};\n exp[KEY] = exec(fn);\n $export($export.S + $export.F * fails(function(){ fn(1); }), 'Object', exp);\n};","// 19.1.2.14 Object.keys(O)\nvar toObject = require('./_to-object')\n , $keys = require('./_object-keys');\n\nrequire('./_object-sap')('keys', function(){\n return function keys(it){\n return $keys(toObject(it));\n };\n});","require('../../modules/es6.object.keys');\nmodule.exports = require('../../modules/_core').Object.keys;","module.exports = { \"default\": require(\"core-js/library/fn/object/keys\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nexports.default = function (instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n};","var $export = require('./_export');\n// 19.1.2.4 / 15.2.3.6 Object.defineProperty(O, P, Attributes)\n$export($export.S + $export.F * !require('./_descriptors'), 'Object', {defineProperty: require('./_object-dp').f});","require('../../modules/es6.object.define-property');\nvar $Object = require('../../modules/_core').Object;\nmodule.exports = function defineProperty(it, key, desc){\n return $Object.defineProperty(it, key, desc);\n};","module.exports = { \"default\": require(\"core-js/library/fn/object/define-property\"), __esModule: true };","\"use strict\";\n\nexports.__esModule = true;\n\nvar _defineProperty = require(\"../core-js/object/define-property\");\n\nvar _defineProperty2 = _interopRequireDefault(_defineProperty);\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nexports.default = function () {\n function defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n (0, _defineProperty2.default)(target, descriptor.key, descriptor);\n }\n }\n\n return function (Constructor, protoProps, staticProps) {\n if (protoProps) defineProperties(Constructor.prototype, protoProps);\n if (staticProps) defineProperties(Constructor, staticProps);\n return Constructor;\n };\n}();","// utility methods for EventSky\n\nexport default {\n\t/**\n\t * This provides a format for event map objects\n\t * @returns {{}}\n\t */\n\tcreateNewEventMap (eventName) {\n\t\treturn {\n\t\t\t// aggregate number of handlers for this event\n\t\t\thandlers: 0,\n\t\t\t_handlers: 0,\n\t\t\t_name: eventName,\n\t\t\ton: {},\n\t\t\tonce: {},\n\t\t\tbeforeAll: {},\n\t\t\tafterAll: {},\n\t\t}\n\t},\n\n\t/**\n\t * Utility used to setup 'when' handlers on parent class\n\t * @param when {string} 'on', 'beforeAll', etc.\n\t * @return function\n\t */\n\tcurryWhenHandler (when) {\n\t\treturn (event, handler) => {\n\t\t\t// verify params\n\t\t\tif (typeof event !== 'string' || event.length < 1 || typeof handler !== 'function') {\n\t\t\t\tconsole.warn(`EventSky warning: \"${event}\" event must be a string and handler must be a function - not set with .${when} handler`)\n\n\t\t\t\treturn this\n\t\t\t}\n\n\t\t\t// ensure the event exists and is setup on the event store\n\t\t\tif (!this.events[event]) {\n\t\t\t\tthis.events[event] = this._utils.createNewEventMap(event)\n\t\t\t}\n\n\t\t\t// check if the event and handler are a duplicate\n\t\t\tif (this.events[event][when] && this.events[event][when] === handler) {\n\t\t\t\tif (!this.config.ignoreDuplicateHandler) {\n\t\t\t\t\tconsole.warn(`EventSky warning: duplicate handler for .${when}('${event}')`)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.events[event].handlers++\n\t\t\tconst _handlerCount = this.events[event]._handlers++\n\t\t\tconst eventId = `id_${event}.${when}.${_handlerCount}`\n\t\t\tthis.events[event][when][eventId] = handler\n\n\t\t\treturn eventId\n\t\t}\n\t},\n\n\tvalidateEventName (context, eventName) {\n\t\tif (!context) {\n\t\t\treturn console.error('EventSky._utils needs to be passed a valid context param')\n\t\t} else if (!eventName || typeof eventName !== 'string') {\n\t\t\tconsole.error('EventSky error: .trigger(event) did not receive a string param')\n\n\t\t\treturn false\n\t\t}\n\n\t\treturn true\n\t},\n}\n","import utils from './utils'\n\nclass EventSky {\n\tconstructor () {\n\t\tthis.config = {\n\t\t\tfirehose: false,\n\t\t\tignoreDuplicateHandler: false, // warns about duplicate event/handler\n\t\t}\n\n\t\tthis._utils = utils\n\n\t\t// map of events\n\t\tthis.events = {}\n\t\tthis._firehose = msg => this.config.firehose ? console.log(`EventSky Firehose >> ${msg}`) : null\n\n\t\t// setup 'when' event handlers\n\t\tthis.on = this._utils.curryWhenHandler.bind(this)('on')\n\t\tthis.once = this._utils.curryWhenHandler.bind(this)('once')\n\t\tthis.beforeAll = this._utils.curryWhenHandler.bind(this)('beforeAll')\n\t\tthis.afterAll = this._utils.curryWhenHandler.bind(this)('afterAll')\n\n\t\t// extend a chain call for eventSky.off.all()\n\t\tthis.off.all = this.allOff.bind(this)\n\t}\n\n\t/**\n\t * Remove a handler for an event, the first parameter can be and event name\n\t * or an eventId to be removed.\n\t * @param eventOrId\n\t * @param handler\n\t * @returns {EventSky}\n\t */\n\toff (eventOrId, handler) {\n\t\t// iterate all events by names\n\t\tObject.keys(this.events).forEach(_eventName => {\n\t\t\t// iterate each 'when' event lifecycle and look for eventId or handler to remove\n\t\t\tObject.keys(this.events[_eventName]).forEach(_eventWhen => {\n\t\t\t\tif (!['beforeAll', 'on', 'once', 'afterAll'].includes(_eventWhen)) return\n\n\t\t\t\t// iterate each event of the current 'when' for event\n\t\t\t\tObject.keys(this.events[_eventName][_eventWhen]).forEach(_eventId => {\n\t\t\t\t\tconst eventNameAndHandlerMatch = (\n\t\t\t\t\t\t\tthis.events[_eventName][_eventWhen][_eventId] === handler &&\n\t\t\t\t\t\t\t_eventName === eventOrId\n\t\t\t\t\t\t)\n\t\t\t\t\tconst eventIdMatch = (!handler && _eventId === eventOrId)\n\n\t\t\t\t\tconst performDelete = (\n\t\t\t\t\t\t\teventNameAndHandlerMatch ||\n\t\t\t\t\t\t\teventIdMatch\n\t\t\t\t\t\t)\n\n\t\t\t\t\tif (performDelete) {\n\t\t\t\t\t\tdelete this.events[_eventName][_eventWhen][_eventId]\n\t\t\t\t\t\tthis.events[_eventName].handlers--\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\n\t\treturn this\n\t}\n\n\t/**\n\t * Turn off all handlers for an event name\n\t * @param eventName {string} the name of the event\n\t * @returns {EventSky}\n\t */\n\tallOff (event) {\n\t\tdelete this.events[event]\n\n\t\tthis._firehose(`.off.all(\"${event}\") removed all event handlers`)\n\n\t\tthis.events[event] = this._utils.createNewEventMap()\n\n\t\treturn this\n\t}\n\n\ttrigger (event, data) {\n\t\tif (!this._utils.validateEventName(this, event)) return this\n\n\t\tif (!this.events[event]) {\n\t\t\tthis._firehose(`\"${event}\" triggered with no handlers setup`)\n\n\t\t\treturn this\n\t\t}\n\n\t\tthis._firehose(`\"${event}\" triggered`)\n\n\t\t// beforeAll\n\t\tconst beforeAll = this.events[event].beforeAll\n\n\t\tObject.keys(beforeAll).forEach(key => {\n\t\t\ttry {\n\t\t\t\tbeforeAll[key](data)\n\t\t\t} catch (e) {\n\t\t\t\tif (!beforeAll[key]) { // check if the method exists\n\t\t\t\t\tconsole.error(`EventSky error: .beforeAll('${event}', ...) handler does not exist`, { eventId: key, data: data })\n\t\t\t\t} else { // else show the method errored\n\t\t\t\t\tconsole.error(`EventSky error: .beforeAll('${event}', ${on[key].name || ('anonymous')}) handler trapped an error`, { error: e, data: data })\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\t// on\n\t\tconst on = this.events[event].on\n\n\t\tObject.keys(on).forEach(key => {\n\t\t\ttry {\n\t\t\t\ton[key](data)\n\t\t\t} catch (e) {\n\t\t\t\tif (!on[key]) { // check if the method exists\n\t\t\t\t\tconsole.error(`EventSky error: .on('${event}', ...) handler does not exist`, { eventId: key, data: data })\n\t\t\t\t} else { // else show the method errored\n\t\t\t\t\tconsole.error(`EventSky error: .on('${event}', ${on[key].name || ('anonymous')}) handler trapped an error`, { error: e, data: data })\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\t// once\n\t\tconst once = this.events[event].once\n\n\t\tObject.keys(once).forEach(key => {\n\t\t\ttry {\n\t\t\t\tonce[key](data)\n\t\t\t} catch (e) {\n\t\t\t\tif (!once[key]) { // check if the method exists\n\t\t\t\t\tconsole.error(`EventSky error: .once('${event}', ...) handler does not exist`, { eventId: key, data: data })\n\t\t\t\t} else { // else show the method errored\n\t\t\t\t\tconsole.error(`EventSky error: .once('${event}', ${on[key].name || ('anonymous')}) handler trapped an error`, { error: e, data: data })\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\t// afterAll\n\t\tconst afterAll = this.events[event].afterAll\n\n\t\tObject.keys(afterAll).forEach(key => {\n\t\t\ttry {\n\t\t\t\tafterAll[key](data)\n\t\t\t} catch (e) {\n\t\t\t\tif (!afterAll[key]) { // check if the method exists\n\t\t\t\t\tconsole.error(`EventSky error: .afterAll('${event}', ...) handler does not exist`, { eventId: key, data: data })\n\t\t\t\t} else { // else show the method errored\n\t\t\t\t\tconsole.error(`EventSky error: .afterAll('${event}', ${on[key].name || ('anonymous')}) handler trapped an error`, { error: e, data: data })\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\treturn this\n\t}\n}\n\nexport default new EventSky()\n"],"names":["it","undefined","TypeError","Object","defined","hasOwnProperty","key","call","toString","slice","propertyIsEnumerable","cof","split","IObject","ceil","Math","floor","isNaN","min","toInteger","max","index","length","global","module","window","self","Function","__g","store","id","px","random","concat","shared","arrayIndexOf","IS_INCLUDES","$this","el","fromIndex","value","O","toIObject","toLength","toIndex","IE_PROTO","uid","object","names","i","result","has","push","keys","$keys","enumBugKeys","core","version","__e","fn","that","aFunction","a","b","c","apply","arguments","isObject","exec","e","require$$0","defineProperty","get","document","is","createElement","require$$1","require$$2","S","val","valueOf","dP","P","Attributes","anObject","toPrimitive","IE8_DOM_DEFINE","bitmap","enumerable","configurable","writable","f","createDesc","$export","type","name","source","own","out","IS_FORCED","F","IS_GLOBAL","G","IS_STATIC","IS_PROTO","IS_BIND","B","IS_WRAP","W","exports","expProto","target","ctx","C","this","virtual","R","hide","U","KEY","exp","fails","toObject","default","__esModule","instance","Constructor","$Object","desc","_defineProperty2","obj","_defineProperty","defineProperties","props","descriptor","protoProps","staticProps","prototype","eventName","when","event","handler","warn","_this","events","_utils","createNewEventMap","config","ignoreDuplicateHandler","handlers","_handlerCount","_handlers","eventId","context","error","console","utils","_firehose","firehose","log","msg","on","curryWhenHandler","bind","once","beforeAll","afterAll","off","all","allOff","eventOrId","forEach","_this2","_eventName","includes","_eventWhen","eventNameAndHandlerMatch","_eventId","eventIdMatch","data","validateEventName"],"mappings":"oSACA,MAAiB,SAASA,GACxB,OAASC,IAAND,EAAgB,KAAME,WAAU,yBAA2BF,EAC9D,OAAOA,MCDQ,SAASA,GACxB,MAAOG,QAAOC,EAAQJ,KCHpBK,KAAoBA,iBACP,SAASL,EAAIM,GAC5B,MAAOD,GAAeE,KAAKP,EAAIM,ICF7BE,KAAcA,WA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T,MAAO9G,GACH+F,EAAK9J,WAGDoJ,gCAAgCd,SAAWqB,EAAG3J,GAAKyF,MAAS,2CAA4C2D,MAAOrF,EAAG8G,KAAMA,YAFxHzB,gCAAgCd,oCAAyCY,QAASlJ,EAAK6K,KAAMA,UAQlGb,GAAWpD,KAAK8B,OAAOJ,GAAO0B,kBAExBA,GAAUK,QAAQ,kBAEnBrK,GAAK6K,GACb,MAAO9G,GACHiG,EAAShK,WAGLoJ,oCAAoCd,SAAWqB,EAAG3J,GAAKyF,MAAS,2CAA4C2D,MAAOrF,EAAG8G,KAAMA,YAF5HzB,oCAAoCd,oCAAyCY,QAASlJ,EAAK6K,KAAMA,OAOrGjE"} \ No newline at end of file +{"version":3,"file":"build.js","sources":["src/utils.js","src/main.js"],"sourcesContent":["// utility methods for EventSky\n\nexport default {\n\t/**\n\t * This provides a format for event map objects\n\t * @returns {{}}\n\t */\n\tcreateNewEventMap (eventName) {\n\t\treturn {\n\t\t\t// aggregate number of handlers for this event\n\t\t\thandlers: 0,\n\t\t\t_handlers: 0,\n\t\t\t_name: eventName,\n\t\t\ton: {},\n\t\t\tonce: {},\n\t\t\tbeforeAll: {},\n\t\t\tafterAll: {},\n\t\t}\n\t},\n\n\t/**\n\t * Utility used to setup 'when' handlers on parent class\n\t * @param when {string} 'on', 'beforeAll', etc.\n\t * @return function\n\t */\n\tcurryWhenHandler (when) {\n\t\treturn (event, handler) => {\n\t\t\t// verify params\n\t\t\tif (typeof event !== 'string' || event.length < 1 || typeof handler !== 'function') {\n\t\t\t\tconsole.warn(`EventSky warning: \"${event}\" event must be a string and handler must be a function - not set with .${when} handler`)\n\n\t\t\t\treturn this\n\t\t\t}\n\n\t\t\t// ensure the event exists and is setup on the event store\n\t\t\tif (!this.events[event]) {\n\t\t\t\tthis.events[event] = this._utils.createNewEventMap(event)\n\t\t\t}\n\n\t\t\t// check if the event and handler are a duplicate\n\t\t\tif (this.events[event][when] && this.events[event][when] === handler) {\n\t\t\t\tif (!this.config.ignoreDuplicateHandler) {\n\t\t\t\t\tconsole.warn(`EventSky warning: duplicate handler for .${when}('${event}')`)\n\t\t\t\t}\n\t\t\t}\n\n\t\t\tthis.events[event].handlers++\n\t\t\tconst _handlerCount = this.events[event]._handlers++\n\t\t\tconst eventId = `id_${event}.${when}.${_handlerCount}`\n\t\t\tthis.events[event][when][eventId] = handler\n\n\t\t\treturn eventId\n\t\t}\n\t},\n\n\tvalidateEventName (context, eventName) {\n\t\tif (!context) {\n\t\t\treturn console.error('EventSky._utils needs to be passed a valid context param')\n\t\t} else if (!eventName || typeof eventName !== 'string') {\n\t\t\tconsole.error('EventSky error: .trigger(event) did not receive a string param')\n\n\t\t\treturn false\n\t\t}\n\n\t\treturn true\n\t},\n}\n","import utils from './utils'\n\nclass EventSky {\n\tconstructor () {\n\t\tthis.config = {\n\t\t\tfirehose: false,\n\t\t\tignoreDuplicateHandler: false, // warns about duplicate event/handler\n\t\t}\n\n\t\tthis._utils = utils\n\n\t\t// map of events\n\t\tthis.events = {}\n\t\tthis._firehose = msg => this.config.firehose ? console.log(`EventSky Firehose >> ${msg}`) : null\n\n\t\t// setup 'when' event handlers\n\t\tthis.on = this._utils.curryWhenHandler.bind(this)('on')\n\t\tthis.once = this._utils.curryWhenHandler.bind(this)('once')\n\t\tthis.beforeAll = this._utils.curryWhenHandler.bind(this)('beforeAll')\n\t\tthis.afterAll = this._utils.curryWhenHandler.bind(this)('afterAll')\n\n\t\t// extend a chain call for eventSky.off.all()\n\t\tthis.off.all = this.allOff.bind(this)\n\t}\n\n\t/**\n\t * Remove a handler for an event, the first parameter can be and event name\n\t * or an eventId to be removed.\n\t * @param eventOrId\n\t * @param handler\n\t * @returns {EventSky}\n\t */\n\toff (eventOrId, handler) {\n\t\t// iterate all events by names\n\t\tObject.keys(this.events).forEach(_eventName => {\n\t\t\t// iterate each 'when' event lifecycle and look for eventId or handler to remove\n\t\t\tObject.keys(this.events[_eventName]).forEach(_eventWhen => {\n\t\t\t\tif (!['beforeAll', 'on', 'once', 'afterAll'].includes(_eventWhen)) return\n\n\t\t\t\t// iterate each event of the current 'when' for event\n\t\t\t\tObject.keys(this.events[_eventName][_eventWhen]).forEach(_eventId => {\n\t\t\t\t\tconst eventNameAndHandlerMatch = (\n\t\t\t\t\t\t\tthis.events[_eventName][_eventWhen][_eventId] === handler &&\n\t\t\t\t\t\t\t_eventName === eventOrId\n\t\t\t\t\t\t)\n\t\t\t\t\tconst eventIdMatch = (!handler && _eventId === eventOrId)\n\n\t\t\t\t\tconst performDelete = (\n\t\t\t\t\t\t\teventNameAndHandlerMatch ||\n\t\t\t\t\t\t\teventIdMatch\n\t\t\t\t\t\t)\n\n\t\t\t\t\tif (performDelete) {\n\t\t\t\t\t\tdelete this.events[_eventName][_eventWhen][_eventId]\n\t\t\t\t\t\tthis.events[_eventName].handlers--\n\t\t\t\t\t}\n\t\t\t\t})\n\t\t\t})\n\t\t})\n\n\t\treturn this\n\t}\n\n\t/**\n\t * Turn off all handlers for an event name\n\t * @param eventName {string} the name of the event\n\t * @returns {EventSky}\n\t */\n\tallOff (event) {\n\t\tdelete this.events[event]\n\n\t\tthis._firehose(`.off.all(\"${event}\") removed all event handlers`)\n\n\t\tthis.events[event] = this._utils.createNewEventMap()\n\n\t\treturn this\n\t}\n\n\ttrigger (event, data) {\n\t\tif (!this._utils.validateEventName(this, event)) return this\n\n\t\tif (!this.events[event]) {\n\t\t\tthis._firehose(`\"${event}\" triggered with no handlers setup`)\n\n\t\t\treturn this\n\t\t}\n\n\t\tthis._firehose(`\"${event}\" triggered`)\n\n\t\t// beforeAll\n\t\tconst beforeAll = this.events[event].beforeAll\n\n\t\tObject.keys(beforeAll).forEach(key => {\n\t\t\ttry {\n\t\t\t\tbeforeAll[key](data)\n\t\t\t} catch (e) {\n\t\t\t\tif (!beforeAll[key]) { // check if the method exists\n\t\t\t\t\tconsole.error(`EventSky error: .beforeAll('${event}', ...) handler does not exist`, { eventId: key, data: data })\n\t\t\t\t} else { // else show the method errored\n\t\t\t\t\tconsole.error(`EventSky error: .beforeAll('${event}', ${on[key].name || ('anonymous')}) handler trapped an error`, { error: e, data: data })\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\t// on\n\t\tconst on = this.events[event].on\n\n\t\tObject.keys(on).forEach(key => {\n\t\t\ttry {\n\t\t\t\ton[key](data)\n\t\t\t} catch (e) {\n\t\t\t\tif (!on[key]) { // check if the method exists\n\t\t\t\t\tconsole.error(`EventSky error: .on('${event}', ...) handler does not exist`, { eventId: key, data: data })\n\t\t\t\t} else { // else show the method errored\n\t\t\t\t\tconsole.error(`EventSky error: .on('${event}', ${on[key].name || ('anonymous')}) handler trapped an error`, { error: e, data: data })\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\t// once\n\t\tconst once = this.events[event].once\n\n\t\tObject.keys(once).forEach(key => {\n\t\t\ttry {\n\t\t\t\tonce[key](data)\n\t\t\t} catch (e) {\n\t\t\t\tif (!once[key]) { // check if the method exists\n\t\t\t\t\tconsole.error(`EventSky error: .once('${event}', ...) handler does not exist`, { eventId: key, data: data })\n\t\t\t\t} else { // else show the method errored\n\t\t\t\t\tconsole.error(`EventSky error: .once('${event}', ${on[key].name || ('anonymous')}) handler trapped an error`, { error: e, data: data })\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\t// afterAll\n\t\tconst afterAll = this.events[event].afterAll\n\n\t\tObject.keys(afterAll).forEach(key => {\n\t\t\ttry {\n\t\t\t\tafterAll[key](data)\n\t\t\t} catch (e) {\n\t\t\t\tif (!afterAll[key]) { // check if the method exists\n\t\t\t\t\tconsole.error(`EventSky error: .afterAll('${event}', ...) handler does not exist`, { eventId: key, data: data })\n\t\t\t\t} else { // else show the method errored\n\t\t\t\t\tconsole.error(`EventSky error: .afterAll('${event}', ${on[key].name || ('anonymous')}) handler trapped an error`, { error: e, data: data })\n\t\t\t\t}\n\t\t\t}\n\t\t})\n\n\t\treturn this\n\t}\n}\n\nexport default new EventSky()\n"],"names":["eventName","when","event","handler","length","warn","_this","events","_utils","createNewEventMap","config","ignoreDuplicateHandler","handlers","_handlerCount","_handlers","eventId","context","error","console","utils","_firehose","firehose","log","msg","on","this","curryWhenHandler","bind","once","beforeAll","afterAll","off","all","allOff","eventOrId","keys","forEach","_this2","_eventName","includes","_eventWhen","eventNameAndHandlerMatch","_eventId","eventIdMatch","data","validateEventName","key","e","name"],"mappings":"kRAEA,kCAKoBA,mBAGP,YACC,QACJA,qEAaSC,oBACV,UAACC,EAAOC,MAEO,gBAAVD,IAAsBA,EAAME,OAAS,GAAwB,kBAAZD,kBACnDE,2BAA2BH,6EAAgFD,eAM/GK,GAAKC,OAAOL,OACXK,OAAOL,GAASI,EAAKE,OAAOC,kBAAkBP,IAIhDI,EAAKC,OAAOL,GAAOD,IAASK,EAAKC,OAAOL,GAAOD,KAAUE,IACvDG,EAAKI,OAAOC,gCACRN,iDAAiDJ,OAASC,WAI/DK,OAAOL,GAAOU,cACbC,GAAgBP,EAAKC,OAAOL,GAAOY,YACnCC,QAAgBb,MAASD,MAAQY,WAClCN,OAAOL,GAAOD,GAAMc,GAAWZ,EAE7BY,+BAIUC,EAAShB,SACtBgB,MAEOhB,GAAkC,gBAAdA,cACvBiB,MAAM,mEAEP,GAJAC,QAAQD,MAAM,yTCgGT,uDArJRP,kBACM,0BACc,QAGpBF,OAASW,OAGTZ,eACAa,UAAY,kBAAOd,GAAKI,OAAOW,SAAWH,QAAQI,4BAA4BC,GAAS,WAGvFC,GAAKC,KAAKjB,OAAOkB,iBAAiBC,KAAKF,MAAM,WAC7CG,KAAOH,KAAKjB,OAAOkB,iBAAiBC,KAAKF,MAAM,aAC/CI,UAAYJ,KAAKjB,OAAOkB,iBAAiBC,KAAKF,MAAM,kBACpDK,SAAWL,KAAKjB,OAAOkB,iBAAiBC,KAAKF,MAAM,iBAGnDM,IAAIC,IAAMP,KAAKQ,OAAON,KAAKF,4CAU5BS,EAAW/B,4BAERgC,KAAKV,KAAKlB,QAAQ6B,QAAQ,mBAEzBD,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S,2CAA4C/B,MAAO8B,EAAGH,KAAMA,YAFxH3B,gCAAgCf,oCAAyCa,QAAS+B,EAAKF,KAAMA,UAQlGd,GAAWL,KAAKlB,OAAOL,GAAO4B,uBAE7BK,KAAKL,GAAUM,QAAQ,kBAEnBU,GAAKF,GACb,MAAOG,GACHjB,EAASgB,WAGL7B,oCAAoCf,SAAWsB,EAAGsB,GAAKE,MAAS,2CAA4C/B,MAAO8B,EAAGH,KAAMA,YAF5H3B,oCAAoCf,oCAAyCa,QAAS+B,EAAKF,KAAMA,OAOrGnB"} \ No newline at end of file diff --git a/src/.babelrc b/src/.babelrc index 6fb1102..ee23019 100644 --- a/src/.babelrc +++ b/src/.babelrc @@ -8,7 +8,6 @@ "stage-2" ], "plugins": [ - "transform-runtime", "transform-object-rest-spread" ], "env": {