1 line
262 KiB
JSON
1 line
262 KiB
JSON
|
{"id":"../../../.nvm/versions/node/v10.13.0/lib/node_modules/parcel-bundler/node_modules/events/events.js","dependencies":[{"name":"/Users/philkunz/gitlab/pushrocks_meta/smartlog-destination-devtools/package.json","includedInParent":true,"mtime":1542067438335},{"name":"/Users/philkunz/.nvm/versions/node/v10.13.0/lib/node_modules/parcel-bundler/node_modules/events/package.json","includedInParent":true,"mtime":1542068254727}],"generated":{"js":"// Copyright Joyent, Inc. and other Node contributors.\n//\n// Permission is hereby granted, free of charge, to any person obtaining a\n// copy of this software and associated documentation files (the\n// \"Software\"), to deal in the Software without restriction, including\n// without limitation the rights to use, copy, modify, merge, publish,\n// distribute, sublicense, and/or sell copies of the Software, and to permit\n// persons to whom the Software is furnished to do so, subject to the\n// following conditions:\n//\n// The above copyright notice and this permission notice shall be included\n// in all copies or substantial portions of the Software.\n//\n// THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\n// OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\n// MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN\n// NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,\n// DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR\n// OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE\n// USE OR OTHER DEALINGS IN THE SOFTWARE.\nfunction EventEmitter() {\n this._events = this._events || {};\n this._maxListeners = this._maxListeners || undefined;\n}\n\nmodule.exports = EventEmitter; // Backwards-compat with node 0.10.x\n\nEventEmitter.EventEmitter = EventEmitter;\nEventEmitter.prototype._events = undefined;\nEventEmitter.prototype._maxListeners = undefined; // By default EventEmitters will print a warning if more than 10 listeners are\n// added to it. This is a useful default which helps finding memory leaks.\n\nEventEmitter.defaultMaxListeners = 10; // Obviously not all Emitters should be limited to 10. This function allows\n// that to be increased. Set to zero for unlimited.\n\nEventEmitter.prototype.setMaxListeners = function (n) {\n if (!isNumber(n) || n < 0 || isNaN(n)) throw TypeError('n must be a positive number');\n this._maxListeners = n;\n return this;\n};\n\nEventEmitter.prototype.emit = function (type) {\n var er, handler, len, args, i, listeners;\n if (!this._events) this._events = {}; // If there is no 'error' event listener then throw.\n\n if (type === 'error') {\n if (!this._events.error || isObject(this._events.error) && !this._events.error.length) {\n er = arguments[1];\n\n if (er instanceof Error) {\n throw er; // Unhandled 'error' event\n } else {\n // At least give some kind of context to the user\n var err = new Error('Uncaught, unspecified \"error\" event. (' + er + ')');\n err.context = er;\n throw err;\n }\n }\n }\n\n handler = this._events[type];\n if (isUndefined(handler)) return false;\n\n if (isFunction(handler)) {\n switch (arguments.length) {\n // fast cases\n case 1:\n handler.call(this);\n break;\n\n case 2:\n handler.call(this, arguments[1]);\n break;\n\n case 3:\n handler.call(this, arguments[1], arguments[2]);\n break;\n // slower\n\n default:\n args = Array.prototype.slice.call(arguments, 1);\n handler.apply(this, args);\n }\n } else if (isObject(handler)) {\n args = Array.prototype.slice.call(arguments, 1);\n listeners = handler.slice();\n len = listeners.length;\n\n for (i = 0; i < len; i++) listeners[i].apply(this, args);\n }\n\n return true;\n};\n\nEventEmitter.prototype.addListener = function (type, listener) {\n var m;\n if (!isFunction(listener)) throw TypeError('listener must be a function');\n if (!this._events) this._events = {}; // To avoid recur
|