@irrelon/emitter 5.0.6 → 6.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintignore +2 -1
- package/.prettierignore +2 -1
- package/.prettierrc.yml +18 -1
- package/dist/cjs/src/Emitter.d.ts +71 -20
- package/dist/cjs/src/Emitter.js +128 -78
- package/dist/cjs/tests/Emitter.test.js +125 -52
- package/dist/cjs/tsconfig-cjs.tsbuildinfo +1 -1
- package/dist/{mjs → esm}/src/Emitter.d.ts +71 -20
- package/dist/{mjs → esm}/src/Emitter.js +128 -67
- package/dist/{mjs → esm}/tests/Emitter.test.js +123 -50
- package/dist/esm/tsconfig-esm.tsbuildinfo +1 -0
- package/fixup.sh +1 -1
- package/package.json +8 -7
- package/readme.md +101 -20
- package/src/Emitter.ts +287 -114
- package/tests/Emitter.test.ts +249 -82
- package/tsconfig-cjs.json +1 -1
- package/tsconfig-esm.json +8 -0
- package/tsconfig.json +33 -5
- package/fixPaths.cjs +0 -183
- package/tsconfig-base.json +0 -36
- /package/dist/{mjs → esm}/package.json +0 -0
- /package/dist/{mjs → esm}/tests/Emitter.test.d.ts +0 -0
- /package/dist/{mjs → esm}/tsconfig.tsbuildinfo +0 -0
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export var
|
|
2
|
-
(function (
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
})(
|
|
1
|
+
export var ListenerReturnFlag;
|
|
2
|
+
(function (ListenerReturnFlag) {
|
|
3
|
+
ListenerReturnFlag["none"] = "!+_NONE";
|
|
4
|
+
ListenerReturnFlag["cancel"] = "!+_CANCEL";
|
|
5
|
+
})(ListenerReturnFlag || (ListenerReturnFlag = {}));
|
|
6
6
|
/**
|
|
7
7
|
* Creates a new class with the capability to emit events.
|
|
8
8
|
*/
|
|
@@ -28,11 +28,13 @@ export class Emitter {
|
|
|
28
28
|
}, 1);
|
|
29
29
|
};
|
|
30
30
|
this._eventListeners = this._eventListeners || {};
|
|
31
|
-
const nonNullableEventListeners = this._eventListeners[eventName] = this._eventListeners[eventName] || {};
|
|
31
|
+
const nonNullableEventListeners = (this._eventListeners[eventName] = this._eventListeners[eventName] || {});
|
|
32
32
|
nonNullableEventListeners[id] = nonNullableEventListeners[id] || [];
|
|
33
33
|
nonNullableEventListeners[id].push(listener);
|
|
34
34
|
// Check for any static emitters, and fire the event if any exist
|
|
35
|
-
if (!this._eventStaticEmitters ||
|
|
35
|
+
if (!this._eventStaticEmitters ||
|
|
36
|
+
!this._eventStaticEmitters[eventName] ||
|
|
37
|
+
!this._eventStaticEmitters[eventName].length)
|
|
36
38
|
return this;
|
|
37
39
|
// Emit events for each emitter
|
|
38
40
|
for (let i = 0; i < this._eventStaticEmitters[eventName].length; i++) {
|
|
@@ -145,97 +147,148 @@ export class Emitter {
|
|
|
145
147
|
// Both id and listener were provided, remove for the specific id
|
|
146
148
|
return this._off(eventName, rest[0], rest[1]);
|
|
147
149
|
}
|
|
150
|
+
_emitToSingleListener(listener, data) {
|
|
151
|
+
return listener(...data);
|
|
152
|
+
}
|
|
153
|
+
_emitToArrayOfListeners(arr, data) {
|
|
154
|
+
const arrCount = arr.length;
|
|
155
|
+
const resultArr = [];
|
|
156
|
+
for (let arrIndex = 0; arrIndex < arrCount; arrIndex++) {
|
|
157
|
+
// Check we have a function to execute
|
|
158
|
+
const tmpFunc = arr[arrIndex];
|
|
159
|
+
if (typeof tmpFunc !== "function") {
|
|
160
|
+
continue;
|
|
161
|
+
}
|
|
162
|
+
const eventListenerResponse = tmpFunc(...data);
|
|
163
|
+
resultArr.push(eventListenerResponse);
|
|
164
|
+
if (eventListenerResponse === ListenerReturnFlag.cancel) {
|
|
165
|
+
// Cancel further event processing
|
|
166
|
+
break;
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
return resultArr;
|
|
170
|
+
}
|
|
148
171
|
/**
|
|
149
|
-
*
|
|
150
|
-
*
|
|
151
|
-
*
|
|
172
|
+
* Call an event listener by name. The `rpc()` function differs from `emit()` in
|
|
173
|
+
* that it will only call and return data from the first event listener for the
|
|
174
|
+
* event rather than all event listeners. If you have more than one event listener
|
|
175
|
+
* assigned to the event, all others except the first will be ignored and will
|
|
176
|
+
* not receive the event.
|
|
177
|
+
* @param eventName The name of the event to call the listener for.
|
|
178
|
+
* @param {...any} data The arguments to send to the listening method.
|
|
152
179
|
* If you are sending multiple arguments, separate them with a comma so
|
|
153
180
|
* that they are received by the function as separate arguments.
|
|
154
181
|
* @return {number}
|
|
155
|
-
* @example #
|
|
182
|
+
* @example #Call the Event Listener
|
|
156
183
|
* // Emit the event named "hello"
|
|
157
184
|
* myEntity.emit('hello');
|
|
158
|
-
* @example #
|
|
185
|
+
* @example #Call the Event Listener With Data Object
|
|
159
186
|
* // Emit the event named "hello"
|
|
160
187
|
* myEntity.emit('hello', {moo: true});
|
|
161
|
-
* @example #
|
|
188
|
+
* @example #Call the Event Listener With Multiple Data Values
|
|
162
189
|
* // Emit the event named "hello"
|
|
163
190
|
* myEntity.emit('hello', {moo: true}, 'someString');
|
|
164
|
-
* @example #
|
|
191
|
+
* @example #Register the Listener for Event Data
|
|
165
192
|
* // Set a listener to listen for the data (multiple values emitted
|
|
166
193
|
* // from an event are passed as function arguments)
|
|
167
|
-
*
|
|
168
|
-
* console.log(arg1, arg2);
|
|
194
|
+
* myEntity.on('hello', function (arg1, arg2) {
|
|
195
|
+
* console.log("Arguments:", arg1, arg2);
|
|
196
|
+
* return "foo";
|
|
169
197
|
* }
|
|
170
198
|
*
|
|
171
199
|
* // Emit the event named "hello"
|
|
172
|
-
* myEntity.emit('hello', 'data1', 'data2');
|
|
200
|
+
* const result = myEntity.emit('hello', 'data1', 'data2');
|
|
201
|
+
* console.log("Result:", result);
|
|
173
202
|
*
|
|
174
203
|
* // The console output is:
|
|
175
|
-
* //
|
|
204
|
+
* // Arguments: data1 data2
|
|
205
|
+
* // Result: "foo"
|
|
176
206
|
*/
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
207
|
+
rpc(eventName, ...data) {
|
|
208
|
+
return this.rpcId(eventName, "*", ...data);
|
|
209
|
+
}
|
|
210
|
+
rpcId(eventName, id, ...data) {
|
|
211
|
+
if (!this._eventListeners || !this._eventListeners[eventName]) {
|
|
212
|
+
throw new Error("Cannot make an rpc call without at least one event listener and none were found");
|
|
180
213
|
}
|
|
181
|
-
|
|
182
|
-
let returnFlag = EventReturnFlag.none;
|
|
214
|
+
let emitterResult;
|
|
183
215
|
this._eventsEmitting = true;
|
|
184
|
-
if (this._eventListeners[eventName]
|
|
185
|
-
// Handle
|
|
216
|
+
if (this._eventListeners[eventName][id]) {
|
|
217
|
+
// Handle id emit
|
|
186
218
|
const arr = this._eventListeners[eventName][id];
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
219
|
+
emitterResult = this._emitToSingleListener(arr[0], data);
|
|
220
|
+
}
|
|
221
|
+
else if (id !== "*" && this._eventListeners[eventName]["*"]) {
|
|
222
|
+
// Handle global emit if the id passed wasn't already a global (*) id
|
|
223
|
+
const arr = this._eventListeners[eventName]["*"];
|
|
224
|
+
emitterResult = this._emitToSingleListener(arr[0], data);
|
|
225
|
+
}
|
|
226
|
+
else {
|
|
227
|
+
if (id === "*") {
|
|
228
|
+
throw new Error(`Cannot make an rpc call to event "${eventName}" without at least one event listener and none were found, register a listener via on("${eventName}", () => { ...some listener code })`);
|
|
195
229
|
}
|
|
230
|
+
throw new Error(`Cannot make an rpc call to event "${eventName}" and id "${id}" without at least one event listener and none were found, register a listener via on("${eventName}", "${id}", () => { ...some listener code })`);
|
|
196
231
|
}
|
|
197
232
|
this._eventsEmitting = false;
|
|
198
233
|
this._processRemovalQueue();
|
|
199
|
-
return
|
|
234
|
+
return emitterResult;
|
|
235
|
+
}
|
|
236
|
+
/**
|
|
237
|
+
* Emit an event by name.
|
|
238
|
+
* @param eventName The name of the event to emit.
|
|
239
|
+
* @param {...any} data The arguments to send to any listening methods.
|
|
240
|
+
* If you are sending multiple arguments, separate them with a comma so
|
|
241
|
+
* that they are received by the function as separate arguments.
|
|
242
|
+
* @return {number}
|
|
243
|
+
* @example #Emit an Event
|
|
244
|
+
* // Emit the event named "hello"
|
|
245
|
+
* myEntity.emit('hello');
|
|
246
|
+
* @example #Emit an Event With Data Object
|
|
247
|
+
* // Emit the event named "hello"
|
|
248
|
+
* myEntity.emit('hello', {moo: true});
|
|
249
|
+
* @example #Emit an Event With Multiple Data Values
|
|
250
|
+
* // Emit the event named "hello"
|
|
251
|
+
* myEntity.emit('hello', {moo: true}, 'someString');
|
|
252
|
+
* @example #Listen for Event Data
|
|
253
|
+
* // Set a listener to listen for the data (multiple values emitted
|
|
254
|
+
* // from an event are passed as function arguments)
|
|
255
|
+
* myEntity.on('hello', function (arg1, arg2) {
|
|
256
|
+
* console.log("Arguments:", arg1, arg2);
|
|
257
|
+
* return "foo";
|
|
258
|
+
* }
|
|
259
|
+
*
|
|
260
|
+
* // Emit the event named "hello"
|
|
261
|
+
* // The result is returned as an array of all return values
|
|
262
|
+
* // from all the listeners for the event
|
|
263
|
+
* const result = myEntity.emit('hello', 'data1', 'data2');
|
|
264
|
+
* console.log("Result:", result);
|
|
265
|
+
*
|
|
266
|
+
* // The console output is:
|
|
267
|
+
* // Arguments: data1 data2
|
|
268
|
+
* // Result: ["foo"]
|
|
269
|
+
*/
|
|
270
|
+
emit(eventName, ...data) {
|
|
271
|
+
return this.emitId(eventName, "*", ...data);
|
|
200
272
|
}
|
|
201
273
|
emitId(eventName, id, ...data) {
|
|
202
|
-
if (!this._eventListeners) {
|
|
203
|
-
return
|
|
274
|
+
if (!this._eventListeners || !this._eventListeners[eventName]) {
|
|
275
|
+
return [];
|
|
204
276
|
}
|
|
205
|
-
|
|
277
|
+
let emitterResult = [];
|
|
206
278
|
this._eventsEmitting = true;
|
|
207
|
-
if (!this._eventListeners[eventName]) {
|
|
208
|
-
this._eventsEmitting = false;
|
|
209
|
-
this._processRemovalQueue();
|
|
210
|
-
return EventReturnFlag.none;
|
|
211
|
-
}
|
|
212
279
|
// Handle id emit
|
|
213
280
|
if (this._eventListeners[eventName][id]) {
|
|
214
281
|
const arr = this._eventListeners[eventName][id];
|
|
215
|
-
|
|
216
|
-
for (let arrIndex = 0; arrIndex < arrCount; arrIndex++) {
|
|
217
|
-
// Check we have a function to execute
|
|
218
|
-
const tmpFunc = arr[arrIndex];
|
|
219
|
-
if (typeof tmpFunc === "function") {
|
|
220
|
-
tmpFunc.call(this, ...data);
|
|
221
|
-
}
|
|
222
|
-
}
|
|
282
|
+
emitterResult = emitterResult.concat(this._emitToArrayOfListeners(arr, data));
|
|
223
283
|
}
|
|
224
|
-
// Handle global emit
|
|
225
|
-
if (this._eventListeners[eventName]["*"]) {
|
|
284
|
+
// Handle global emit if the id passed wasn't already a global (*) id
|
|
285
|
+
if (id !== "*" && this._eventListeners[eventName]["*"]) {
|
|
226
286
|
const arr = this._eventListeners[eventName]["*"];
|
|
227
|
-
|
|
228
|
-
for (let arrIndex = 0; arrIndex < arrCount; arrIndex++) {
|
|
229
|
-
// Check we have a function to execute
|
|
230
|
-
const tmpFunc = arr[arrIndex];
|
|
231
|
-
if (typeof tmpFunc === "function") {
|
|
232
|
-
tmpFunc.call(this, ...data);
|
|
233
|
-
}
|
|
234
|
-
}
|
|
287
|
+
emitterResult = emitterResult.concat(this._emitToArrayOfListeners(arr, data));
|
|
235
288
|
}
|
|
236
289
|
this._eventsEmitting = false;
|
|
237
290
|
this._processRemovalQueue();
|
|
238
|
-
return
|
|
291
|
+
return emitterResult;
|
|
239
292
|
}
|
|
240
293
|
/**
|
|
241
294
|
* Creates a persistent emitter record that will fire a listener if
|
|
@@ -266,8 +319,8 @@ export class Emitter {
|
|
|
266
319
|
this._eventStaticEmitters = this._eventStaticEmitters || {};
|
|
267
320
|
this._eventStaticEmitters[eventName] = this._eventStaticEmitters[eventName] || [];
|
|
268
321
|
this._eventStaticEmitters[eventName].push({
|
|
269
|
-
|
|
270
|
-
|
|
322
|
+
id: "*",
|
|
323
|
+
args: data
|
|
271
324
|
});
|
|
272
325
|
this._processRemovalQueue();
|
|
273
326
|
return this;
|
|
@@ -318,7 +371,7 @@ export class Emitter {
|
|
|
318
371
|
this._eventStaticEmitters[eventName] = this._eventStaticEmitters[eventName] || [];
|
|
319
372
|
this._eventStaticEmitters[eventName].push({
|
|
320
373
|
id,
|
|
321
|
-
|
|
374
|
+
args: data
|
|
322
375
|
});
|
|
323
376
|
this._processRemovalQueue();
|
|
324
377
|
return this;
|
|
@@ -420,13 +473,21 @@ export class Emitter {
|
|
|
420
473
|
}
|
|
421
474
|
return this;
|
|
422
475
|
}
|
|
476
|
+
/**
|
|
477
|
+
* Returns true if the result from an emit() call passed as the first
|
|
478
|
+
* argument contains a cancellation flag.
|
|
479
|
+
* @param resultArr
|
|
480
|
+
*/
|
|
481
|
+
didCancel(resultArr) {
|
|
482
|
+
return resultArr.findIndex((result) => result === ListenerReturnFlag.cancel) > -1;
|
|
483
|
+
}
|
|
423
484
|
/**
|
|
424
485
|
* If events are cleared with the off() method while the event emitter is
|
|
425
486
|
* actively processing any events then the off() calls get added to a
|
|
426
487
|
* queue to be executed after the event emitter is finished. This stops
|
|
427
|
-
* errors that might occur by potentially
|
|
428
|
-
* the emitter is running through them. This method is called after
|
|
429
|
-
* event emitter is finished processing.
|
|
488
|
+
* errors that might occur by potentially mutating the event listener array
|
|
489
|
+
* while the emitter is running through them. This method is called after
|
|
490
|
+
* the event emitter is finished processing.
|
|
430
491
|
* @private
|
|
431
492
|
*/
|
|
432
493
|
_processRemovalQueue() {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import assert from "assert";
|
|
2
|
-
import { Emitter } from "../src/Emitter";
|
|
2
|
+
import { Emitter, ListenerReturnFlag } from "../src/Emitter";
|
|
3
3
|
let expectedAssertions = 0;
|
|
4
4
|
let actualAssertions = 0;
|
|
5
5
|
function expect(val) {
|
|
@@ -24,11 +24,12 @@ describe("Emitter", () => {
|
|
|
24
24
|
describe("new Emitter()", () => {
|
|
25
25
|
it("Creates emitter instance by instantiation", () => {
|
|
26
26
|
const myClass = new Emitter();
|
|
27
|
-
myClass.on("moo", () => {
|
|
28
|
-
});
|
|
27
|
+
myClass.on("moo", () => { });
|
|
29
28
|
assert.strictEqual(myClass._eventListeners?.moo["*"].length, 1, "Listener registered on event");
|
|
30
29
|
myClass.off("moo");
|
|
31
|
-
assert.strictEqual(!myClass._eventListeners?.moo ||
|
|
30
|
+
assert.strictEqual(!myClass._eventListeners?.moo ||
|
|
31
|
+
!myClass._eventListeners.moo["*"] ||
|
|
32
|
+
myClass._eventListeners.moo["*"].length, true, "Listeners all removed from event");
|
|
32
33
|
});
|
|
33
34
|
it("Supports extending Emitter as a base class", () => {
|
|
34
35
|
let testFuncCount = 0;
|
|
@@ -77,26 +78,34 @@ describe("Emitter", () => {
|
|
|
77
78
|
myClass.emitId("moo", "testId", "foo");
|
|
78
79
|
assert.strictEqual(emitCount, 1, "Event fired correctly");
|
|
79
80
|
myClass.off("moo", "testId");
|
|
80
|
-
assert.strictEqual(!myClass._eventListeners?.moo ||
|
|
81
|
-
|
|
82
|
-
|
|
81
|
+
assert.strictEqual(!myClass._eventListeners?.moo ||
|
|
82
|
+
!myClass._eventListeners?.moo["testId"] ||
|
|
83
|
+
myClass._eventListeners?.moo["testId"].length === 0, true, "Listeners all removed from event");
|
|
84
|
+
assert.strictEqual(myClass._eventListeners?.moo &&
|
|
85
|
+
myClass._eventListeners?.moo["^^noId"] &&
|
|
86
|
+
myClass._eventListeners?.moo["^^noId"].length === 1, true, "Global listener still there");
|
|
87
|
+
assert.strictEqual(!myClass._eventListeners?.moo ||
|
|
88
|
+
!myClass._eventListeners?.moo["*"] ||
|
|
89
|
+
myClass._eventListeners?.moo["*"].length === 0, true, "Global listener still there");
|
|
83
90
|
myClass.off("moo");
|
|
84
|
-
assert.strictEqual(!myClass._eventListeners?.moo ||
|
|
91
|
+
assert.strictEqual(!myClass._eventListeners?.moo ||
|
|
92
|
+
!myClass._eventListeners?.moo["*"] ||
|
|
93
|
+
myClass._eventListeners?.moo["*"].length === 0, true, "Listeners all removed from event");
|
|
85
94
|
});
|
|
86
95
|
});
|
|
87
96
|
describe("emit()", () => {
|
|
88
97
|
it("Supports type safe usage", async () => {
|
|
89
98
|
const emitter = new Emitter();
|
|
90
99
|
let listenerFiredCount = 0;
|
|
91
|
-
emitter.on("person",
|
|
100
|
+
emitter.on("person", (name) => {
|
|
92
101
|
return new Promise((resolve) => {
|
|
93
102
|
setTimeout(() => {
|
|
94
103
|
listenerFiredCount++;
|
|
95
|
-
resolve();
|
|
104
|
+
resolve(name);
|
|
96
105
|
}, 1000);
|
|
97
106
|
});
|
|
98
107
|
});
|
|
99
|
-
emitter.on("post",
|
|
108
|
+
emitter.on("post", () => {
|
|
100
109
|
return new Promise((resolve) => {
|
|
101
110
|
setTimeout(() => {
|
|
102
111
|
listenerFiredCount++;
|
|
@@ -104,7 +113,7 @@ describe("Emitter", () => {
|
|
|
104
113
|
}, 1000);
|
|
105
114
|
});
|
|
106
115
|
});
|
|
107
|
-
emitter.on("post",
|
|
116
|
+
emitter.on("post", () => {
|
|
108
117
|
return new Promise((resolve) => {
|
|
109
118
|
setTimeout(() => {
|
|
110
119
|
listenerFiredCount++;
|
|
@@ -113,9 +122,10 @@ describe("Emitter", () => {
|
|
|
113
122
|
});
|
|
114
123
|
});
|
|
115
124
|
const time = new Date().getTime();
|
|
116
|
-
await emitter.emit("post");
|
|
125
|
+
await Promise.all(emitter.emit("post"));
|
|
117
126
|
const delta = new Date().getTime() - time;
|
|
118
127
|
assert.ok(delta > 900, `Delta was not correct, await may not have paused? Delta was: ${delta}`);
|
|
128
|
+
assert.ok(listenerFiredCount === 2, `listenerFiredCount was not correct, await may not have paused? listenerFiredCount was: ${listenerFiredCount}`);
|
|
119
129
|
});
|
|
120
130
|
it("Supports awaiting async listeners", async () => {
|
|
121
131
|
const emitter = new Emitter();
|
|
@@ -137,42 +147,107 @@ describe("Emitter", () => {
|
|
|
137
147
|
});
|
|
138
148
|
});
|
|
139
149
|
const time = new Date().getTime();
|
|
140
|
-
await emitter.emit("foo");
|
|
150
|
+
await Promise.all(emitter.emit("foo"));
|
|
151
|
+
const delta = new Date().getTime() - time;
|
|
152
|
+
assert.ok(delta > 900, "Delta was not correct, await may not have paused?");
|
|
153
|
+
});
|
|
154
|
+
it("Supports awaiting async and non-async listener return data", async () => {
|
|
155
|
+
const emitter = new Emitter();
|
|
156
|
+
let listenerFiredCount = 0;
|
|
157
|
+
emitter.on("foo", () => {
|
|
158
|
+
return new Promise((resolve) => {
|
|
159
|
+
setTimeout(() => {
|
|
160
|
+
listenerFiredCount++;
|
|
161
|
+
resolve("Foo1 Return Value");
|
|
162
|
+
}, 1000);
|
|
163
|
+
});
|
|
164
|
+
});
|
|
165
|
+
emitter.on("foo", () => {
|
|
166
|
+
return "Foo2 Return Value";
|
|
167
|
+
});
|
|
168
|
+
const time = new Date().getTime();
|
|
169
|
+
const results = await Promise.all(emitter.emit("foo"));
|
|
170
|
+
const delta = new Date().getTime() - time;
|
|
171
|
+
assert.ok(delta > 900, "Delta was not correct, await may not have paused?");
|
|
172
|
+
assert.ok(listenerFiredCount === 1, "listenerFiredCount was not correct, await may not have been used?");
|
|
173
|
+
assert.strictEqual(results[0], "Foo1 Return Value", "Return data for foo1 was not correct");
|
|
174
|
+
assert.strictEqual(results[1], "Foo2 Return Value", "Return data for foo2 was not correct");
|
|
175
|
+
});
|
|
176
|
+
it("Supports awaiting async and non-async rpc listener return data", async () => {
|
|
177
|
+
const emitter = new Emitter();
|
|
178
|
+
let listenerFiredCount = 0;
|
|
179
|
+
emitter.on("foo1", () => {
|
|
180
|
+
return new Promise((resolve) => {
|
|
181
|
+
setTimeout(() => {
|
|
182
|
+
listenerFiredCount++;
|
|
183
|
+
resolve("Foo1 Return Value");
|
|
184
|
+
}, 1000);
|
|
185
|
+
});
|
|
186
|
+
});
|
|
187
|
+
emitter.on("foo2", () => {
|
|
188
|
+
return "Foo2 Return Value";
|
|
189
|
+
});
|
|
190
|
+
const time = new Date().getTime();
|
|
191
|
+
const result1 = await emitter.rpc("foo1");
|
|
192
|
+
const result2 = emitter.rpc("foo2");
|
|
141
193
|
const delta = new Date().getTime() - time;
|
|
142
194
|
assert.ok(delta > 900, "Delta was not correct, await may not have paused?");
|
|
195
|
+
assert.ok(listenerFiredCount === 1, "listenerFiredCount was not correct, await may not have been used?");
|
|
196
|
+
assert.strictEqual(result1, "Foo1 Return Value", "Return data for foo1 was not correct");
|
|
197
|
+
assert.strictEqual(result2, "Foo2 Return Value", "Return data for foo2 was not correct");
|
|
198
|
+
});
|
|
199
|
+
it("Supports responding with a cancellation signal", async () => {
|
|
200
|
+
const emitter = new Emitter();
|
|
201
|
+
let listenerFiredCount = 0;
|
|
202
|
+
emitter.on("foo", () => {
|
|
203
|
+
listenerFiredCount++;
|
|
204
|
+
return "Foo1 Return Value";
|
|
205
|
+
});
|
|
206
|
+
emitter.on("foo", () => {
|
|
207
|
+
listenerFiredCount++;
|
|
208
|
+
// This listener will respond with a cancellation, this should terminate further listener calls
|
|
209
|
+
return ListenerReturnFlag.cancel;
|
|
210
|
+
});
|
|
211
|
+
emitter.on("foo", () => {
|
|
212
|
+
listenerFiredCount++;
|
|
213
|
+
return "Foo3 Return Value";
|
|
214
|
+
});
|
|
215
|
+
emitter.on("foo", () => {
|
|
216
|
+
listenerFiredCount++;
|
|
217
|
+
return "Foo4 Return Value";
|
|
218
|
+
});
|
|
219
|
+
const results = emitter.emit("foo");
|
|
220
|
+
assert.ok(listenerFiredCount === 2, "listenerFiredCount was not correct, await may not have been used?");
|
|
221
|
+
assert.strictEqual(results[0], "Foo1 Return Value", "Return data should be a cancel flag");
|
|
222
|
+
assert.strictEqual(results[1], ListenerReturnFlag.cancel, "Return data should be a cancel flag");
|
|
223
|
+
assert.ok(emitter.didCancel(results), "didCancel should detect a cancel flag");
|
|
143
224
|
});
|
|
144
225
|
});
|
|
145
226
|
describe("off()", () => {
|
|
146
227
|
it("Cancels all listeners (event)", () => {
|
|
147
228
|
const myClass = new Emitter();
|
|
148
|
-
const listener1 = () => {
|
|
149
|
-
};
|
|
150
|
-
|
|
151
|
-
};
|
|
152
|
-
myClass.on("moo", () => {
|
|
153
|
-
});
|
|
229
|
+
const listener1 = () => { };
|
|
230
|
+
const listener2 = () => { };
|
|
231
|
+
myClass.on("moo", () => { });
|
|
154
232
|
assert.strictEqual(myClass._eventListeners?.moo["*"].length, 1, "Listeners registered on event");
|
|
155
|
-
myClass.on("moo", "testId", () => {
|
|
156
|
-
});
|
|
233
|
+
myClass.on("moo", "testId", () => { });
|
|
157
234
|
assert.strictEqual(myClass._eventListeners?.moo["testId"].length, 1, "Listeners registered on event");
|
|
158
235
|
myClass.on("moo", listener1);
|
|
159
236
|
assert.strictEqual(myClass._eventListeners?.moo["*"].length, 2, "Listeners registered on event");
|
|
160
237
|
myClass.on("moo", "testId", listener2);
|
|
161
238
|
assert.strictEqual(myClass._eventListeners?.moo["testId"].length, 2, "Listeners registered on event");
|
|
162
239
|
myClass.off("moo");
|
|
163
|
-
assert.strictEqual(!myClass._eventListeners?.moo ||
|
|
240
|
+
assert.strictEqual(!myClass._eventListeners?.moo ||
|
|
241
|
+
(myClass._eventListeners?.moo["*"].length === 0 &&
|
|
242
|
+
myClass._eventListeners?.moo["testId"].length === 0), true, "Listeners all removed from event");
|
|
164
243
|
});
|
|
165
244
|
it("Cancels id-based listeners (event, id)", () => {
|
|
166
245
|
const myClass = new Emitter();
|
|
167
|
-
const listener1 = () => {
|
|
168
|
-
};
|
|
169
|
-
|
|
170
|
-
};
|
|
171
|
-
myClass.on("moo", () => {
|
|
172
|
-
});
|
|
246
|
+
const listener1 = () => { };
|
|
247
|
+
const listener2 = () => { };
|
|
248
|
+
myClass.on("moo", () => { });
|
|
173
249
|
assert.strictEqual(myClass._eventListeners?.moo["*"].length, 1, "Listeners registered on event");
|
|
174
|
-
myClass.on("moo", "testId", () => {
|
|
175
|
-
});
|
|
250
|
+
myClass.on("moo", "testId", () => { });
|
|
176
251
|
assert.strictEqual(myClass._eventListeners?.moo["testId"].length, 1, "Listeners registered on event");
|
|
177
252
|
myClass.on("moo", listener1);
|
|
178
253
|
assert.strictEqual(myClass._eventListeners?.moo["*"].length, 2, "Listeners registered on event");
|
|
@@ -184,15 +259,11 @@ describe("Emitter", () => {
|
|
|
184
259
|
});
|
|
185
260
|
it("Cancels listener-based listeners (event, listener)", () => {
|
|
186
261
|
const myClass = new Emitter();
|
|
187
|
-
const listener1 = () => {
|
|
188
|
-
};
|
|
189
|
-
|
|
190
|
-
};
|
|
191
|
-
myClass.on("moo", () => {
|
|
192
|
-
});
|
|
262
|
+
const listener1 = () => { };
|
|
263
|
+
const listener2 = () => { };
|
|
264
|
+
myClass.on("moo", () => { });
|
|
193
265
|
assert.strictEqual(myClass._eventListeners?.moo["*"].length, 1, "Listeners registered on event");
|
|
194
|
-
myClass.on("moo", "testId", () => {
|
|
195
|
-
});
|
|
266
|
+
myClass.on("moo", "testId", () => { });
|
|
196
267
|
assert.strictEqual(myClass._eventListeners?.moo["testId"].length, 1, "Listeners registered on event");
|
|
197
268
|
myClass.on("moo", listener1);
|
|
198
269
|
assert.strictEqual(myClass._eventListeners?.moo["*"].length, 2, "Listeners registered on event");
|
|
@@ -204,15 +275,11 @@ describe("Emitter", () => {
|
|
|
204
275
|
});
|
|
205
276
|
it("Cancels id-based + listener-based listeners (event, id, listener)", () => {
|
|
206
277
|
const myClass = new Emitter();
|
|
207
|
-
const listener1 = () => {
|
|
208
|
-
};
|
|
209
|
-
|
|
210
|
-
};
|
|
211
|
-
myClass.on("moo", () => {
|
|
212
|
-
});
|
|
278
|
+
const listener1 = () => { };
|
|
279
|
+
const listener2 = () => { };
|
|
280
|
+
myClass.on("moo", () => { });
|
|
213
281
|
assert.strictEqual(myClass._eventListeners?.moo["*"].length, 1, "Listeners registered on event");
|
|
214
|
-
myClass.on("moo", "testId", () => {
|
|
215
|
-
});
|
|
282
|
+
myClass.on("moo", "testId", () => { });
|
|
216
283
|
assert.strictEqual(myClass._eventListeners?.moo["testId"].length, 1, "Listeners registered on event");
|
|
217
284
|
myClass.on("moo", listener1);
|
|
218
285
|
assert.strictEqual(myClass._eventListeners?.moo["*"].length, 2, "Listeners registered on event");
|
|
@@ -327,10 +394,16 @@ describe("Emitter", () => {
|
|
|
327
394
|
myClass.emitId("moo", "testId", "foo");
|
|
328
395
|
assert.strictEqual(emitCount, 2, "Event fired correctly");
|
|
329
396
|
myClass.off("moo", "testId");
|
|
330
|
-
assert.strictEqual(!myClass._eventListeners?.moo ||
|
|
331
|
-
|
|
397
|
+
assert.strictEqual(!myClass._eventListeners?.moo ||
|
|
398
|
+
!myClass._eventListeners?.moo["testId"] ||
|
|
399
|
+
myClass._eventListeners?.moo["testId"].length, true, "Listeners all removed from event");
|
|
400
|
+
assert.strictEqual(myClass._eventListeners?.moo &&
|
|
401
|
+
myClass._eventListeners?.moo["*"] &&
|
|
402
|
+
myClass._eventListeners?.moo["*"].length === 1, true, "Global listener still there");
|
|
332
403
|
myClass.off("moo");
|
|
333
|
-
assert.strictEqual(!myClass._eventListeners?.moo ||
|
|
404
|
+
assert.strictEqual(!myClass._eventListeners?.moo ||
|
|
405
|
+
!myClass._eventListeners?.moo["*"] ||
|
|
406
|
+
myClass._eventListeners?.moo["*"].length === 0, true, "Listeners all removed from event");
|
|
334
407
|
});
|
|
335
408
|
});
|
|
336
409
|
});
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"program":{"fileNames":["../../node_modules/typescript/lib/lib.es5.d.ts","../../node_modules/typescript/lib/lib.es2015.d.ts","../../node_modules/typescript/lib/lib.es2016.d.ts","../../node_modules/typescript/lib/lib.es2017.d.ts","../../node_modules/typescript/lib/lib.es2018.d.ts","../../node_modules/typescript/lib/lib.es2019.d.ts","../../node_modules/typescript/lib/lib.es2020.d.ts","../../node_modules/typescript/lib/lib.es2021.d.ts","../../node_modules/typescript/lib/lib.es2022.d.ts","../../node_modules/typescript/lib/lib.es2023.d.ts","../../node_modules/typescript/lib/lib.esnext.d.ts","../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../node_modules/typescript/lib/lib.es2017.date.d.ts","../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../node_modules/typescript/lib/lib.es2019.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../node_modules/typescript/lib/lib.es2021.promise.d.ts","../../node_modules/typescript/lib/lib.es2021.string.d.ts","../../node_modules/typescript/lib/lib.es2021.weakref.d.ts","../../node_modules/typescript/lib/lib.es2021.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.array.d.ts","../../node_modules/typescript/lib/lib.es2022.error.d.ts","../../node_modules/typescript/lib/lib.es2022.intl.d.ts","../../node_modules/typescript/lib/lib.es2022.object.d.ts","../../node_modules/typescript/lib/lib.es2022.sharedmemory.d.ts","../../node_modules/typescript/lib/lib.es2022.string.d.ts","../../node_modules/typescript/lib/lib.es2022.regexp.d.ts","../../node_modules/typescript/lib/lib.es2023.array.d.ts","../../node_modules/typescript/lib/lib.es2023.collection.d.ts","../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../node_modules/typescript/lib/lib.esnext.disposable.d.ts","../../node_modules/typescript/lib/lib.esnext.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.d.ts","../../node_modules/typescript/lib/lib.decorators.legacy.d.ts","../../src/emitter.ts","../../tests/emitter.test.ts","../../node_modules/@types/node/assert.d.ts","../../node_modules/@types/node/assert/strict.d.ts","../../node_modules/@types/node/globals.d.ts","../../node_modules/@types/node/async_hooks.d.ts","../../node_modules/@types/node/buffer.d.ts","../../node_modules/@types/node/child_process.d.ts","../../node_modules/@types/node/cluster.d.ts","../../node_modules/@types/node/console.d.ts","../../node_modules/@types/node/constants.d.ts","../../node_modules/@types/node/crypto.d.ts","../../node_modules/@types/node/dgram.d.ts","../../node_modules/@types/node/diagnostics_channel.d.ts","../../node_modules/@types/node/dns.d.ts","../../node_modules/@types/node/dns/promises.d.ts","../../node_modules/@types/node/domain.d.ts","../../node_modules/@types/node/events.d.ts","../../node_modules/@types/node/fs.d.ts","../../node_modules/@types/node/fs/promises.d.ts","../../node_modules/@types/node/http.d.ts","../../node_modules/@types/node/http2.d.ts","../../node_modules/@types/node/https.d.ts","../../node_modules/@types/node/inspector.d.ts","../../node_modules/@types/node/module.d.ts","../../node_modules/@types/node/net.d.ts","../../node_modules/@types/node/os.d.ts","../../node_modules/@types/node/path.d.ts","../../node_modules/@types/node/perf_hooks.d.ts","../../node_modules/@types/node/process.d.ts","../../node_modules/@types/node/punycode.d.ts","../../node_modules/@types/node/querystring.d.ts","../../node_modules/@types/node/readline.d.ts","../../node_modules/@types/node/readline/promises.d.ts","../../node_modules/@types/node/repl.d.ts","../../node_modules/@types/node/stream.d.ts","../../node_modules/@types/node/stream/promises.d.ts","../../node_modules/@types/node/stream/consumers.d.ts","../../node_modules/@types/node/stream/web.d.ts","../../node_modules/@types/node/string_decoder.d.ts","../../node_modules/@types/node/test.d.ts","../../node_modules/@types/node/timers.d.ts","../../node_modules/@types/node/timers/promises.d.ts","../../node_modules/@types/node/tls.d.ts","../../node_modules/@types/node/trace_events.d.ts","../../node_modules/@types/node/tty.d.ts","../../node_modules/@types/node/url.d.ts","../../node_modules/@types/node/util.d.ts","../../node_modules/@types/node/v8.d.ts","../../node_modules/@types/node/vm.d.ts","../../node_modules/@types/node/wasi.d.ts","../../node_modules/@types/node/worker_threads.d.ts","../../node_modules/@types/node/zlib.d.ts","../../node_modules/@types/node/globals.global.d.ts","../../node_modules/@types/node/index.d.ts","../../node_modules/@jest/expect-utils/build/index.d.ts","../../node_modules/jest-matcher-utils/node_modules/chalk/index.d.ts","../../node_modules/@sinclair/typebox/typebox.d.ts","../../node_modules/@jest/schemas/build/index.d.ts","../../node_modules/pretty-format/build/index.d.ts","../../node_modules/jest-diff/build/index.d.ts","../../node_modules/jest-matcher-utils/build/index.d.ts","../../node_modules/expect/build/index.d.ts","../../node_modules/@types/jest/index.d.ts"],"fileInfos":[{"version":"f33e5332b24c3773e930e212cbb8b6867c8ba3ec4492064ea78e55a524d57450","affectsGlobalScope":true},"45b7ab580deca34ae9729e97c13cfd999df04416a79116c3bfb483804f85ded4","26f2f787e82c4222710f3b676b4d83eb5ad0a72fa7b746f03449e7a026ce5073","9a68c0c07ae2fa71b44384a839b7b8d81662a236d4b9ac30916718f7510b1b2d","5e1c4c362065a6b95ff952c0eab010f04dcd2c3494e813b493ecfd4fcb9fc0d8","68d73b4a11549f9c0b7d352d10e91e5dca8faa3322bfb77b661839c42b1ddec7","5efce4fc3c29ea84e8928f97adec086e3dc876365e0982cc8479a07954a3efd4","feecb1be483ed332fad555aff858affd90a48ab19ba7272ee084704eb7167569","5514e54f17d6d74ecefedc73c504eadffdeda79c7ea205cf9febead32d45c4bc","1c0cdb8dc619bc549c3e5020643e7cf7ae7940058e8c7e5aefa5871b6d86f44b","bed7b7ba0eb5a160b69af72814b4dde371968e40b6c5e73d3a9f7bee407d158c",{"version":"138fb588d26538783b78d1e3b2c2cc12d55840b97bf5e08bca7f7a174fbe2f17","affectsGlobalScope":true},{"version":"dc2df20b1bcdc8c2d34af4926e2c3ab15ffe1160a63e58b7e09833f616efff44","affectsGlobalScope":true},{"version":"4443e68b35f3332f753eacc66a04ac1d2053b8b035a0e0ac1d455392b5e243b3","affectsGlobalScope":true},{"version":"bc47685641087c015972a3f072480889f0d6c65515f12bd85222f49a98952ed7","affectsGlobalScope":true},{"version":"0dc1e7ceda9b8b9b455c3a2d67b0412feab00bd2f66656cd8850e8831b08b537","affectsGlobalScope":true},{"version":"ce691fb9e5c64efb9547083e4a34091bcbe5bdb41027e310ebba8f7d96a98671","affectsGlobalScope":true},{"version":"8d697a2a929a5fcb38b7a65594020fcef05ec1630804a33748829c5ff53640d0","affectsGlobalScope":true},{"version":"4ff2a353abf8a80ee399af572debb8faab2d33ad38c4b4474cff7f26e7653b8d","affectsGlobalScope":true},{"version":"93495ff27b8746f55d19fcbcdbaccc99fd95f19d057aed1bd2c0cafe1335fbf0","affectsGlobalScope":true},{"version":"6fc23bb8c3965964be8c597310a2878b53a0306edb71d4b5a4dfe760186bcc01","affectsGlobalScope":true},{"version":"38f0219c9e23c915ef9790ab1d680440d95419ad264816fa15009a8851e79119","affectsGlobalScope":true},{"version":"bb42a7797d996412ecdc5b2787720de477103a0b2e53058569069a0e2bae6c7e","affectsGlobalScope":true},{"version":"4738f2420687fd85629c9efb470793bb753709c2379e5f85bc1815d875ceadcd","affectsGlobalScope":true},{"version":"2f11ff796926e0832f9ae148008138ad583bd181899ab7dd768a2666700b1893","affectsGlobalScope":true},{"version":"4de680d5bb41c17f7f68e0419412ca23c98d5749dcaaea1896172f06435891fc","affectsGlobalScope":true},{"version":"9fc46429fbe091ac5ad2608c657201eb68b6f1b8341bd6d670047d32ed0a88fa","affectsGlobalScope":true},{"version":"61c37c1de663cf4171e1192466e52c7a382afa58da01b1dc75058f032ddf0839","affectsGlobalScope":true},{"version":"b541a838a13f9234aba650a825393ffc2292dc0fc87681a5d81ef0c96d281e7a","affectsGlobalScope":true},{"version":"e0275cd0e42990dc3a16f0b7c8bca3efe87f1c8ad404f80c6db1c7c0b828c59f","affectsGlobalScope":true},{"version":"811ec78f7fefcabbda4bfa93b3eb67d9ae166ef95f9bff989d964061cbf81a0c","affectsGlobalScope":true},{"version":"717937616a17072082152a2ef351cb51f98802fb4b2fdabd32399843875974ca","affectsGlobalScope":true},{"version":"d7e7d9b7b50e5f22c915b525acc5a49a7a6584cf8f62d0569e557c5cfc4b2ac2","affectsGlobalScope":true},{"version":"71c37f4c9543f31dfced6c7840e068c5a5aacb7b89111a4364b1d5276b852557","affectsGlobalScope":true},{"version":"576711e016cf4f1804676043e6a0a5414252560eb57de9faceee34d79798c850","affectsGlobalScope":true},{"version":"89c1b1281ba7b8a96efc676b11b264de7a8374c5ea1e6617f11880a13fc56dc6","affectsGlobalScope":true},{"version":"49ed889be54031e1044af0ad2c603d627b8bda8b50c1a68435fe85583901d072","affectsGlobalScope":true},{"version":"e93d098658ce4f0c8a0779e6cab91d0259efb88a318137f686ad76f8410ca270","affectsGlobalScope":true},{"version":"063600664504610fe3e99b717a1223f8b1900087fab0b4cad1496a114744f8df","affectsGlobalScope":true},{"version":"934019d7e3c81950f9a8426d093458b65d5aff2c7c1511233c0fd5b941e608ab","affectsGlobalScope":true},{"version":"bf14a426dbbf1022d11bd08d6b8e709a2e9d246f0c6c1032f3b2edb9a902adbe","affectsGlobalScope":true},{"version":"ec0104fee478075cb5171e5f4e3f23add8e02d845ae0165bfa3f1099241fa2aa","affectsGlobalScope":true},{"version":"2b72d528b2e2fe3c57889ca7baef5e13a56c957b946906d03767c642f386bbc3","affectsGlobalScope":true},{"version":"acae90d417bee324b1372813b5a00829d31c7eb670d299cd7f8f9a648ac05688","affectsGlobalScope":true},{"version":"368af93f74c9c932edd84c58883e736c9e3d53cec1fe24c0b0ff451f529ceab1","affectsGlobalScope":true},{"version":"af3dd424cf267428f30ccfc376f47a2c0114546b55c44d8c0f1d57d841e28d74","affectsGlobalScope":true},{"version":"995c005ab91a498455ea8dfb63aa9f83fa2ea793c3d8aa344be4a1678d06d399","affectsGlobalScope":true},{"version":"51e547984877a62227042850456de71a5c45e7fe86b7c975c6e68896c86fa23b","affectsGlobalScope":true},{"version":"62a4966981264d1f04c44eb0f4b5bdc3d81c1a54725608861e44755aa24ad6a5","affectsGlobalScope":true},{"version":"4fa6ed14e98aa80b91f61b9805c653ee82af3502dc21c9da5268d3857772ca05","affectsGlobalScope":true},{"version":"e6633e05da3ff36e6da2ec170d0d03ccf33de50ca4dc6f5aeecb572cedd162fb","affectsGlobalScope":true},{"version":"86a34c7a13de9cabc43161348f663624b56871ed80986e41d214932ddd8d6719","affectsGlobalScope":true},{"version":"8444af78980e3b20b49324f4a16ba35024fef3ee069a0eb67616ea6ca821c47a","affectsGlobalScope":true},{"version":"caccc56c72713969e1cfe5c3d44e5bab151544d9d2b373d7dbe5a1e4166652be","affectsGlobalScope":true},{"version":"3287d9d085fbd618c3971944b65b4be57859f5415f495b33a6adc994edd2f004","affectsGlobalScope":true},{"version":"50d53ccd31f6667aff66e3d62adf948879a3a16f05d89882d1188084ee415bbc","affectsGlobalScope":true},{"version":"08a58483392df5fcc1db57d782e87734f77ae9eab42516028acbfe46f29a3ef7","affectsGlobalScope":true},{"version":"436aaf437562f276ec2ddbee2f2cdedac7664c1e4c1d2c36839ddd582eeb3d0a","affectsGlobalScope":true},{"version":"13f6e6380c78e15e140243dc4be2fa546c287c6d61f4729bc2dd7cf449605471","affectsGlobalScope":true},{"version":"4350e5922fecd4bedda2964d69c213a1436349d0b8d260dd902795f5b94dc74b","affectsGlobalScope":true},{"version":"d4b1d2c51d058fc21ec2629fff7a76249dec2e36e12960ea056e3ef89174080f","affectsGlobalScope":true},{"version":"33358442698bb565130f52ba79bfd3d4d484ac85fe33f3cb1759c54d18201393","affectsGlobalScope":true},{"version":"782dec38049b92d4e85c1585fbea5474a219c6984a35b004963b00beb1aab538","affectsGlobalScope":true},{"version":"56d457af26414c080c425574ed0b56e75cc0bf96ab12d6b6977e44b7ca938934","signature":"0e330e7814a04b66aa6f8192d6da8ae183a826b5f5977bcc536b6c267170a535"},{"version":"75bacf6089744c7f756cbc4076105b078708a164084eb522ec88a14da79e5efe","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"9122ed7070e054b73ebab37c2373a196def2d90e7d1a9a7fcd9d46b0e51fae78","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"e31b69b603075736c59065f0c89606f93068600d94b456dda77248c8b2a803a9","affectsGlobalScope":true},"21a167fec8f933752fb8157f06d28fab6817af3ad9b0bdb1908a10762391eab9",{"version":"002d6d5f044365b3fbfba0ba9be3bb57cac09b81547c8df4b0795755d2081d90","affectsGlobalScope":true},"0c0cee62cb619aed81133b904f644515ba3064487002a7da83fd8aa07b1b4abd","5a94487653355b56018122d92392beb2e5f4a6c63ba5cef83bbe1c99775ef713",{"version":"d5135ad93b33adcce80b18f8065087934cdc1730d63db58562edcf017e1aad9b","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","c4cfc9a6e2ebb8bc8c0e2392dfc4056993ced3b35069ebf132ac18ca7a562881","bb9c4ffa5e6290c6980b63c815cdd1625876dadb2efaf77edbe82984be93e55e","75ecef44f126e2ae018b4abbd85b6e8a2e2ba1638ebec56cc64274643ce3567b","f30bb836526d930a74593f7b0f5c1c46d10856415a8f69e5e2fc3db80371e362","14b5aa23c5d0ae1907bc696ac7b6915d88f7d85799cc0dc2dcf98fbce2c5a67c","5c439dafdc09abe4d6c260a96b822fa0ba5be7203c71a63ab1f1423cd9e838ea",{"version":"bae4ea23beb8397755b935cb84d3cdc6cdb0b1b4a329b90de9fc6c8774d71994","affectsGlobalScope":true},"cec36af22f514322f870e81d30675c78df82ae8bf4863f5fd4e4424c040c678d","df36874d9e56aff601e921c4b3971d37cf66d14f6455935ce821e6cad13b1823","3c135ff5bda0355f6b52a10ea931736ec7c5a80b7fb8772019054e0eaa0fd6b6","1abb206a4ecd13b21536b677d7d5f66e0d7316f0d44610197cfcc5776f78884a","dbe5aa5a5dd8bd1c6a8d11b1310c3f0cdabaacc78a37b394a8c7b14faeb5fb84","2c828a5405191d006115ab34e191b8474bc6c86ffdc401d1a9864b1b6e088a58",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"76527127c8b749bee5977408861ce3ee56ec19ddcea8704c628f98ca610283e6","7c013aa892414a7fdcfd861ae524a668eaa3ede8c7c0acafaf611948122c8d93","b68bd7bef90dab08b1866a9fee24f03d9fee10bcb3f587b074e96e61abf6d3f0","cb4f3f03480e1727eae46400606cecaa97f550186ff8fa909ebc00db4180531b",{"version":"b3624aed92dab6da8484280d3cb3e2f4130ec3f4ef3f8201c95144ae9e898bb6","affectsGlobalScope":true},"5153a2fd150e46ce57bb3f8db1318d33f6ad3261ed70ceeff92281c0608c74a3","d1a78a3c5708807e8de3e399f91df4797c62e44b02195eefc2209b2e713e54ee","36b03690b628eab08703d63f04eaa89c5df202e5f1edf3989f13ad389cd2c091","0effadd232a20498b11308058e334d3339cc5bf8c4c858393e38d9d4c0013dcf","25846d43937c672bab7e8195f3d881f93495df712ee901860effc109918938cc","556bf5c36deb62cffa1bf697c1789fe008ec82db0273025001db66732714e9d9","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","23b89798789dffbd437c0c423f5d02d11f9736aea73d6abf16db4f812ff36eda","24ad30a03d6c9266b63540956868dd70fa2dc523d60d780d6586eb0c281946bc",{"version":"970a90f76d4d219ad60819d61f5994514087ba94c985647a3474a5a3d12714ed","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","4c8525f256873c7ba3135338c647eaf0ca7115a1a2805ae2d0056629461186ce","3c13ef48634e7b5012fcf7e8fce7496352c2d779a7201389ca96a2a81ee4314d","5d0a25ec910fa36595f85a67ac992d7a53dd4064a1ba6aea1c9f14ab73a023f2",{"version":"bfe39beb986d2a2e512c091cbe924f1c415bc65de54de0e2f6a0dc6f84c183d9","affectsGlobalScope":true},"2d526e6f21d8cc66ac11ada32874e95ae88d870c6c9d3d9d4e03b1d1f9ad7b8e","06d7c42d256f0ce6afe1b2b6cfbc97ab391f29dadb00dd0ae8e8f23f5bc916c3","ec4bd1b200670fb567920db572d6701ed42a9641d09c4ff6869768c8f81b404c","e59a892d87e72733e2a9ca21611b9beb52977be2696c7ba4b216cbbb9a48f5aa","d2ec52f565f0570e90b659811347bd689f8c6039b11eaaccd0f243759d46da6e","8a300fa9b698845a1f9c41ecbe2c5966634582a8e2020d51abcace9b55aa959e",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"854a39fe9c9e32cc0855380e0f16bbb25217c3b62d8a687fe2b663ba44b3b5a1","763e521cf114b80e0dd0e21ca49b9f8ae62e8999555a5e7bade8ce36b33001c2","0d14fa22c41fdc7277e6f71473b20ebc07f40f00e38875142335d5b63cdfc9d2","032cbd1883827ca3728c1400145403b62e65b7b584a0d2115ae538c9edec7936","427ce5854885cfc34387e09de05c1d5c1acf94c2143e1693f1d9ff54880573e7","bed2c4f96fab3348be4a34d88dcb12578c1b2475b07c6acd369e99e227718d81","e3ba509d3dce019b3190ceb2f3fc88e2610ab717122dabd91a9efaa37804040d","cda0cb09b995489b7f4c57f168cd31b83dcbaa7aad49612734fb3c9c73f6e4f2","3b105d5a0dacc73812d93e90d3c7243fd5a9c0566a2e63bc2964ca12d882c8e8",{"version":"458e2fd1185e659cb800ef68d01ef77de70dcab8860bedf6d94eaebe736751f1","affectsGlobalScope":true}],"root":[64,65],"options":{"allowJs":false,"allowSyntheticDefaultImports":true,"declaration":true,"downlevelIteration":true,"esModuleInterop":true,"inlineSourceMap":false,"module":99,"outDir":"./","skipLibCheck":false,"strict":true,"target":99},"fileIdsList":[[111],[111,121],[111,123,126],[66,111],[69,111],[70,75,111],[71,81,82,89,99,110,111],[71,72,81,89,111],[73,111],[74,75,82,90,111],[75,99,107,111],[76,78,81,89,111],[77,111],[78,79,111],[80,81,111],[81,111],[81,82,83,99,110,111],[81,82,83,99,102,111],[111,115],[84,89,99,110,111],[81,82,84,85,89,99,107,110,111],[84,86,99,107,110,111],[66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,117],[81,87,111],[88,110,111],[78,81,89,99,111],[90,111],[91,111],[69,92,111],[93,109,111,115],[94,111],[95,111],[81,96,97,111],[96,98,111,113],[81,99,100,101,102,111],[99,101,111],[99,100,111],[102,111],[103,111],[81,105,106,111],[105,106,111],[75,89,99,107,111],[108,111],[89,109,111],[70,84,95,110,111],[75,111],[99,111,112],[111,113],[111,114],[70,75,81,83,92,99,110,111,113,115],[99,111,116],[111,119,125],[111,123],[111,120,124],[111,122],[64,66,111]],"referencedMap":[[119,1],[122,2],[121,1],[127,3],[66,4],[67,4],[69,5],[70,6],[71,7],[72,8],[73,9],[74,10],[75,11],[76,12],[77,13],[78,14],[79,14],[80,15],[81,16],[82,17],[83,18],[68,19],[117,1],[84,20],[85,21],[86,22],[118,23],[87,24],[88,25],[89,26],[90,27],[91,28],[92,29],[93,30],[94,31],[95,32],[96,33],[97,33],[98,34],[99,35],[101,36],[100,37],[102,38],[103,39],[104,1],[105,40],[106,41],[107,42],[108,43],[109,44],[110,45],[111,46],[112,47],[113,48],[114,49],[115,50],[116,51],[126,52],[124,53],[125,54],[120,1],[123,55],[62,1],[63,1],[13,1],[12,1],[2,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[3,1],[4,1],[22,1],[26,1],[23,1],[24,1],[25,1],[27,1],[28,1],[29,1],[5,1],[30,1],[31,1],[32,1],[33,1],[6,1],[37,1],[34,1],[35,1],[36,1],[38,1],[7,1],[39,1],[44,1],[45,1],[40,1],[41,1],[42,1],[43,1],[8,1],[49,1],[46,1],[47,1],[48,1],[50,1],[9,1],[51,1],[52,1],[53,1],[56,1],[54,1],[55,1],[57,1],[58,1],[10,1],[1,1],[11,1],[61,1],[60,1],[59,1],[64,1],[65,56]],"exportedModulesMap":[[119,1],[122,2],[121,1],[127,3],[66,4],[67,4],[69,5],[70,6],[71,7],[72,8],[73,9],[74,10],[75,11],[76,12],[77,13],[78,14],[79,14],[80,15],[81,16],[82,17],[83,18],[68,19],[117,1],[84,20],[85,21],[86,22],[118,23],[87,24],[88,25],[89,26],[90,27],[91,28],[92,29],[93,30],[94,31],[95,32],[96,33],[97,33],[98,34],[99,35],[101,36],[100,37],[102,38],[103,39],[104,1],[105,40],[106,41],[107,42],[108,43],[109,44],[110,45],[111,46],[112,47],[113,48],[114,49],[115,50],[116,51],[126,52],[124,53],[125,54],[120,1],[123,55],[62,1],[63,1],[13,1],[12,1],[2,1],[14,1],[15,1],[16,1],[17,1],[18,1],[19,1],[20,1],[21,1],[3,1],[4,1],[22,1],[26,1],[23,1],[24,1],[25,1],[27,1],[28,1],[29,1],[5,1],[30,1],[31,1],[32,1],[33,1],[6,1],[37,1],[34,1],[35,1],[36,1],[38,1],[7,1],[39,1],[44,1],[45,1],[40,1],[41,1],[42,1],[43,1],[8,1],[49,1],[46,1],[47,1],[48,1],[50,1],[9,1],[51,1],[52,1],[53,1],[56,1],[54,1],[55,1],[57,1],[58,1],[10,1],[1,1],[11,1],[61,1],[60,1],[59,1]],"semanticDiagnosticsPerFile":[119,122,121,127,66,67,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,68,117,84,85,86,118,87,88,89,90,91,92,93,94,95,96,97,98,99,101,100,102,103,104,105,106,107,108,109,110,111,112,113,114,115,116,126,124,125,120,123,62,63,13,12,2,14,15,16,17,18,19,20,21,3,4,22,26,23,24,25,27,28,29,5,30,31,32,33,6,37,34,35,36,38,7,39,44,45,40,41,42,43,8,49,46,47,48,50,9,51,52,53,56,54,55,57,58,10,1,11,61,60,59,64,65]},"version":"5.3.2"}
|