Revert "Commit updated Javascript packages"
This reverts commit a88734348a.
This commit is contained in:
22
build/javascript/node_modules/tiny-emitter/LICENSE
generated
vendored
22
build/javascript/node_modules/tiny-emitter/LICENSE
generated
vendored
@@ -1,22 +0,0 @@
|
||||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2017 Scott Corgan
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in all
|
||||
copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||
SOFTWARE.
|
||||
|
||||
88
build/javascript/node_modules/tiny-emitter/README.md
generated
vendored
88
build/javascript/node_modules/tiny-emitter/README.md
generated
vendored
@@ -1,88 +0,0 @@
|
||||
# tiny-emitter
|
||||
|
||||
A tiny (less than 1k) event emitter library.
|
||||
|
||||
## Install
|
||||
|
||||
### npm
|
||||
|
||||
```
|
||||
npm install tiny-emitter --save
|
||||
```
|
||||
|
||||
## Usage
|
||||
|
||||
```js
|
||||
var Emitter = require('tiny-emitter');
|
||||
var emitter = new Emitter();
|
||||
|
||||
emitter.on('some-event', function (arg1, arg2, arg3) {
|
||||
//
|
||||
});
|
||||
|
||||
emitter.emit('some-event', 'arg1 value', 'arg2 value', 'arg3 value');
|
||||
```
|
||||
|
||||
Alternatively, you can skip the initialization step by requiring `tiny-emitter/instance` instead. This pulls in an already initialized emitter.
|
||||
|
||||
```js
|
||||
var emitter = require('tiny-emitter/instance');
|
||||
|
||||
emitter.on('some-event', function (arg1, arg2, arg3) {
|
||||
//
|
||||
});
|
||||
|
||||
emitter.emit('some-event', 'arg1 value', 'arg2 value', 'arg3 value');
|
||||
```
|
||||
|
||||
## Instance Methods
|
||||
|
||||
### on(event, callback[, context])
|
||||
|
||||
Subscribe to an event
|
||||
|
||||
* `event` - the name of the event to subscribe to
|
||||
* `callback` - the function to call when event is emitted
|
||||
* `context` - (OPTIONAL) - the context to bind the event callback to
|
||||
|
||||
### once(event, callback[, context])
|
||||
|
||||
Subscribe to an event only **once**
|
||||
|
||||
* `event` - the name of the event to subscribe to
|
||||
* `callback` - the function to call when event is emitted
|
||||
* `context` - (OPTIONAL) - the context to bind the event callback to
|
||||
|
||||
### off(event[, callback])
|
||||
|
||||
Unsubscribe from an event or all events. If no callback is provided, it unsubscribes you from all events.
|
||||
|
||||
* `event` - the name of the event to unsubscribe from
|
||||
* `callback` - the function used when binding to the event
|
||||
|
||||
### emit(event[, arguments...])
|
||||
|
||||
Trigger a named event
|
||||
|
||||
* `event` - the event name to emit
|
||||
* `arguments...` - any number of arguments to pass to the event subscribers
|
||||
|
||||
## Test and Build
|
||||
|
||||
Build (Tests, Browserifies, and minifies)
|
||||
|
||||
```
|
||||
npm install
|
||||
npm run build
|
||||
```
|
||||
|
||||
Test
|
||||
|
||||
```
|
||||
npm install
|
||||
npm test
|
||||
```
|
||||
|
||||
## License
|
||||
|
||||
[MIT](https://github.com/scottcorgan/tiny-emitter/blob/master/LICENSE)
|
||||
6
build/javascript/node_modules/tiny-emitter/index.d.ts
generated
vendored
6
build/javascript/node_modules/tiny-emitter/index.d.ts
generated
vendored
@@ -1,6 +0,0 @@
|
||||
export declare class TinyEmitter {
|
||||
on(event: string, callback: Function, ctx?: any): this;
|
||||
once(event: string, callback: Function, ctx?: any): this;
|
||||
emit(event: string, ...args: any[]): this;
|
||||
off(event: string, callback?: Function): this;
|
||||
}
|
||||
67
build/javascript/node_modules/tiny-emitter/index.js
generated
vendored
67
build/javascript/node_modules/tiny-emitter/index.js
generated
vendored
@@ -1,67 +0,0 @@
|
||||
function E () {
|
||||
// Keep this empty so it's easier to inherit from
|
||||
// (via https://github.com/lipsmack from https://github.com/scottcorgan/tiny-emitter/issues/3)
|
||||
}
|
||||
|
||||
E.prototype = {
|
||||
on: function (name, callback, ctx) {
|
||||
var e = this.e || (this.e = {});
|
||||
|
||||
(e[name] || (e[name] = [])).push({
|
||||
fn: callback,
|
||||
ctx: ctx
|
||||
});
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
once: function (name, callback, ctx) {
|
||||
var self = this;
|
||||
function listener () {
|
||||
self.off(name, listener);
|
||||
callback.apply(ctx, arguments);
|
||||
};
|
||||
|
||||
listener._ = callback
|
||||
return this.on(name, listener, ctx);
|
||||
},
|
||||
|
||||
emit: function (name) {
|
||||
var data = [].slice.call(arguments, 1);
|
||||
var evtArr = ((this.e || (this.e = {}))[name] || []).slice();
|
||||
var i = 0;
|
||||
var len = evtArr.length;
|
||||
|
||||
for (i; i < len; i++) {
|
||||
evtArr[i].fn.apply(evtArr[i].ctx, data);
|
||||
}
|
||||
|
||||
return this;
|
||||
},
|
||||
|
||||
off: function (name, callback) {
|
||||
var e = this.e || (this.e = {});
|
||||
var evts = e[name];
|
||||
var liveEvents = [];
|
||||
|
||||
if (evts && callback) {
|
||||
for (var i = 0, len = evts.length; i < len; i++) {
|
||||
if (evts[i].fn !== callback && evts[i].fn._ !== callback)
|
||||
liveEvents.push(evts[i]);
|
||||
}
|
||||
}
|
||||
|
||||
// Remove event from queue to prevent memory leak
|
||||
// Suggested by https://github.com/lazd
|
||||
// Ref: https://github.com/scottcorgan/tiny-emitter/commit/c6ebfaa9bc973b33d110a84a307742b7cf94c953#commitcomment-5024910
|
||||
|
||||
(liveEvents.length)
|
||||
? e[name] = liveEvents
|
||||
: delete e[name];
|
||||
|
||||
return this;
|
||||
}
|
||||
};
|
||||
|
||||
module.exports = E;
|
||||
module.exports.TinyEmitter = E;
|
||||
2
build/javascript/node_modules/tiny-emitter/instance.js
generated
vendored
2
build/javascript/node_modules/tiny-emitter/instance.js
generated
vendored
@@ -1,2 +0,0 @@
|
||||
var E = require('./index.js');
|
||||
module.exports = new E();
|
||||
84
build/javascript/node_modules/tiny-emitter/package.json
generated
vendored
84
build/javascript/node_modules/tiny-emitter/package.json
generated
vendored
@@ -1,84 +0,0 @@
|
||||
{
|
||||
"_args": [
|
||||
[
|
||||
"tiny-emitter@2.1.0",
|
||||
"/home/runner/work/owncast/owncast/build/javascript"
|
||||
]
|
||||
],
|
||||
"_from": "tiny-emitter@2.1.0",
|
||||
"_id": "tiny-emitter@2.1.0",
|
||||
"_inBundle": false,
|
||||
"_integrity": "sha512-NB6Dk1A9xgQPMoGqC5CVXn123gWyte215ONT5Pp5a0yt4nlEoO1ZWeCwpncaekPHXO60i47ihFnZPiRPjRMq4Q==",
|
||||
"_location": "/tiny-emitter",
|
||||
"_phantomChildren": {},
|
||||
"_requested": {
|
||||
"type": "version",
|
||||
"registry": true,
|
||||
"raw": "tiny-emitter@2.1.0",
|
||||
"name": "tiny-emitter",
|
||||
"escapedName": "tiny-emitter",
|
||||
"rawSpec": "2.1.0",
|
||||
"saveSpec": null,
|
||||
"fetchSpec": "2.1.0"
|
||||
},
|
||||
"_requiredBy": [
|
||||
"/@joeattardi/emoji-button"
|
||||
],
|
||||
"_resolved": "https://registry.npmjs.org/tiny-emitter/-/tiny-emitter-2.1.0.tgz",
|
||||
"_spec": "2.1.0",
|
||||
"_where": "/home/runner/work/owncast/owncast/build/javascript",
|
||||
"author": {
|
||||
"name": "Scott Corgan"
|
||||
},
|
||||
"bugs": {
|
||||
"url": "https://github.com/scottcorgan/tiny-emitter/issues"
|
||||
},
|
||||
"description": "A tiny (less than 1k) event emitter library",
|
||||
"devDependencies": {
|
||||
"@tap-format/spec": "0.2.0",
|
||||
"browserify": "11.2.0",
|
||||
"tape": "4.2.1",
|
||||
"testling": "1.7.1",
|
||||
"uglify-js": "2.5.0"
|
||||
},
|
||||
"homepage": "https://github.com/scottcorgan/tiny-emitter#readme",
|
||||
"keywords": [
|
||||
"event",
|
||||
"emitter",
|
||||
"pubsub",
|
||||
"tiny",
|
||||
"events",
|
||||
"bind"
|
||||
],
|
||||
"license": "MIT",
|
||||
"main": "index.js",
|
||||
"name": "tiny-emitter",
|
||||
"repository": {
|
||||
"type": "git",
|
||||
"url": "git+https://github.com/scottcorgan/tiny-emitter.git"
|
||||
},
|
||||
"scripts": {
|
||||
"build": "npm test && npm run bundle && npm run minify",
|
||||
"bundle": "browserify index.js > dist/tinyemitter.js -s TinyEmitter && echo 'Bundled'",
|
||||
"minify": "uglifyjs dist/tinyemitter.js -o dist/tinyemitter.min.js -m && echo 'Minified'",
|
||||
"size": "uglifyjs index.js -o minified.js -m && ls -l && rm minified.js",
|
||||
"test": "testling | tap-format-spec",
|
||||
"test-node": "tape test/index.js | tap-format-spec"
|
||||
},
|
||||
"testling": {
|
||||
"files": [
|
||||
"test/index.js"
|
||||
],
|
||||
"browsers": [
|
||||
"iexplore/10.0",
|
||||
"iexplore/9.0",
|
||||
"firefox/16..latest",
|
||||
"chrome/22..latest",
|
||||
"safari/5.1..latest",
|
||||
"ipad/6.0..latest",
|
||||
"iphone/6.0..latest",
|
||||
"android-browser/4.2..latest"
|
||||
]
|
||||
},
|
||||
"version": "2.1.0"
|
||||
}
|
||||
217
build/javascript/node_modules/tiny-emitter/test/index.js
generated
vendored
217
build/javascript/node_modules/tiny-emitter/test/index.js
generated
vendored
@@ -1,217 +0,0 @@
|
||||
var Emitter = require('../index');
|
||||
var emitter = require('../instance');
|
||||
var test = require('tape');
|
||||
|
||||
test('subscribes to an event', function (t) {
|
||||
var emitter = new Emitter();
|
||||
emitter.on('test', function () {});
|
||||
|
||||
t.equal(emitter.e.test.length, 1, 'subscribed to event');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('subscribes to an event with context', function (t) {
|
||||
var emitter = new Emitter();
|
||||
var context = {
|
||||
contextValue: true
|
||||
};
|
||||
|
||||
emitter.on('test', function () {
|
||||
t.ok(this.contextValue, 'is in context');
|
||||
t.end();
|
||||
}, context);
|
||||
|
||||
emitter.emit('test');
|
||||
});
|
||||
|
||||
test('subscibes only once to an event', function (t) {
|
||||
var emitter = new Emitter();
|
||||
|
||||
emitter.once('test', function () {
|
||||
t.notOk(emitter.e.test, 'removed event from list');
|
||||
t.end();
|
||||
});
|
||||
|
||||
emitter.emit('test');
|
||||
});
|
||||
|
||||
test('keeps context when subscribed only once', function (t) {
|
||||
var emitter = new Emitter();
|
||||
var context = {
|
||||
contextValue: true
|
||||
};
|
||||
|
||||
emitter.once('test', function () {
|
||||
t.ok(this.contextValue, 'is in context');
|
||||
t.notOk(emitter.e.test, 'not subscribed anymore');
|
||||
t.end();
|
||||
}, context);
|
||||
|
||||
emitter.emit('test');
|
||||
});
|
||||
|
||||
test('emits an event', function (t) {
|
||||
var emitter = new Emitter();
|
||||
|
||||
emitter.on('test', function () {
|
||||
t.ok(true, 'triggered event');
|
||||
t.end();
|
||||
});
|
||||
|
||||
emitter.emit('test');
|
||||
});
|
||||
|
||||
test('passes all arguments to event listener', function (t) {
|
||||
var emitter = new Emitter();
|
||||
|
||||
emitter.on('test', function (arg1, arg2) {
|
||||
t.equal(arg1, 'arg1', 'passed the first argument');
|
||||
t.equal(arg2, 'arg2', 'passed the second argument');
|
||||
t.end();
|
||||
});
|
||||
|
||||
emitter.emit('test', 'arg1', 'arg2');
|
||||
});
|
||||
|
||||
test('unsubscribes from all events with name', function (t) {
|
||||
var emitter = new Emitter();
|
||||
emitter.on('test', function () {
|
||||
t.fail('should not get called');
|
||||
});
|
||||
emitter.off('test');
|
||||
emitter.emit('test')
|
||||
|
||||
process.nextTick(function () {
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
|
||||
test('unsubscribes single event with name and callback', function (t) {
|
||||
var emitter = new Emitter();
|
||||
var fn = function () {
|
||||
t.fail('should not get called');
|
||||
}
|
||||
|
||||
emitter.on('test', fn);
|
||||
emitter.off('test', fn);
|
||||
emitter.emit('test')
|
||||
|
||||
process.nextTick(function () {
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
|
||||
// Test added by https://github.com/lazd
|
||||
// From PR: https://github.com/scottcorgan/tiny-emitter/pull/6
|
||||
test('unsubscribes single event with name and callback when subscribed twice', function (t) {
|
||||
var emitter = new Emitter();
|
||||
var fn = function () {
|
||||
t.fail('should not get called');
|
||||
};
|
||||
|
||||
emitter.on('test', fn);
|
||||
emitter.on('test', fn);
|
||||
|
||||
emitter.off('test', fn);
|
||||
emitter.emit('test');
|
||||
|
||||
process.nextTick(function () {
|
||||
t.notOk(emitter.e['test'], 'removes all events');
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
|
||||
test('unsubscribes single event with name and callback when subscribed twice out of order', function (t) {
|
||||
var emitter = new Emitter();
|
||||
var calls = 0;
|
||||
var fn = function () {
|
||||
t.fail('should not get called');
|
||||
};
|
||||
var fn2 = function () {
|
||||
calls++;
|
||||
};
|
||||
|
||||
emitter.on('test', fn);
|
||||
emitter.on('test', fn2);
|
||||
emitter.on('test', fn);
|
||||
emitter.off('test', fn);
|
||||
emitter.emit('test');
|
||||
|
||||
process.nextTick(function () {
|
||||
t.equal(calls, 1, 'callback was called');
|
||||
t.end();
|
||||
});
|
||||
});
|
||||
|
||||
test('removes an event inside another event', function (t) {
|
||||
var emitter = new Emitter();
|
||||
|
||||
emitter.on('test', function () {
|
||||
t.equal(emitter.e.test.length, 1, 'event is still in list');
|
||||
|
||||
emitter.off('test');
|
||||
|
||||
t.notOk(emitter.e.test, 0, 'event is gone from list');
|
||||
t.end();
|
||||
});
|
||||
|
||||
emitter.emit('test');
|
||||
});
|
||||
|
||||
test('event is emitted even if unsubscribed in the event callback', function (t) {
|
||||
var emitter = new Emitter();
|
||||
var calls = 0;
|
||||
var fn = function () {
|
||||
calls += 1;
|
||||
emitter.off('test', fn);
|
||||
};
|
||||
|
||||
emitter.on('test', fn);
|
||||
|
||||
emitter.on('test', function () {
|
||||
calls += 1;
|
||||
});
|
||||
|
||||
emitter.on('test', function () {
|
||||
calls += 1;
|
||||
});
|
||||
|
||||
process.nextTick(function () {
|
||||
t.equal(calls, 3, 'all callbacks were called');
|
||||
t.end();
|
||||
});
|
||||
|
||||
emitter.emit('test');
|
||||
});
|
||||
|
||||
test('calling off before any events added does nothing', function (t) {
|
||||
var emitter = new Emitter();
|
||||
emitter.off('test', function () {});
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('emitting event that has not been subscribed to yet', function (t) {
|
||||
var emitter = new Emitter();
|
||||
|
||||
emitter.emit('some-event', 'some message');
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('unsubscribes single event with name and callback which was subscribed once', function (t) {
|
||||
var emitter = new Emitter();
|
||||
var fn = function () {
|
||||
t.fail('event not unsubscribed');
|
||||
}
|
||||
|
||||
emitter.once('test', fn);
|
||||
emitter.off('test', fn);
|
||||
emitter.emit('test');
|
||||
|
||||
t.end();
|
||||
});
|
||||
|
||||
test('exports an instance', function (t) {
|
||||
t.ok(emitter, 'exports an instance')
|
||||
t.ok(emitter instanceof Emitter, 'an instance of the Emitter class');
|
||||
t.end();
|
||||
});
|
||||
1857
build/javascript/node_modules/tiny-emitter/yarn.lock
generated
vendored
1857
build/javascript/node_modules/tiny-emitter/yarn.lock
generated
vendored
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user