bare-events 2.4.1 → 2.4.2
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/index.js +6 -4
- package/package.json +10 -3
package/index.js
CHANGED
|
@@ -171,6 +171,8 @@ module.exports = exports = class EventEmitter {
|
|
|
171
171
|
|
|
172
172
|
exports.EventEmitter = exports
|
|
173
173
|
|
|
174
|
+
exports.errors = errors
|
|
175
|
+
|
|
174
176
|
exports.defaultMaxListeners = 10
|
|
175
177
|
|
|
176
178
|
exports.on = function on (emitter, name, opts = {}) {
|
|
@@ -270,11 +272,11 @@ exports.once = function once (emitter, name, opts = {}) {
|
|
|
270
272
|
signal
|
|
271
273
|
} = opts
|
|
272
274
|
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
}
|
|
275
|
+
if (signal && signal.aborted) {
|
|
276
|
+
throw errors.OPERATION_ABORTED(signal.reason)
|
|
277
|
+
}
|
|
277
278
|
|
|
279
|
+
return new Promise((resolve, reject) => {
|
|
278
280
|
if (name !== 'error') emitter.on('error', onerror)
|
|
279
281
|
|
|
280
282
|
if (signal) signal.addEventListener('abort', onabort)
|
package/package.json
CHANGED
|
@@ -1,14 +1,21 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bare-events",
|
|
3
|
-
"version": "2.4.
|
|
3
|
+
"version": "2.4.2",
|
|
4
4
|
"description": "Event emitters for JavaScript",
|
|
5
|
-
"
|
|
5
|
+
"exports": {
|
|
6
|
+
".": "./index.js",
|
|
7
|
+
"./package": "./package.json",
|
|
8
|
+
"./errors": "./lib/errors.js"
|
|
9
|
+
},
|
|
6
10
|
"files": [
|
|
7
11
|
"index.js",
|
|
8
12
|
"lib"
|
|
9
13
|
],
|
|
10
14
|
"scripts": {
|
|
11
|
-
"test": "
|
|
15
|
+
"test": "npm run lint && npm run test:bare && npm run test:node",
|
|
16
|
+
"test:bare": "bare test.js",
|
|
17
|
+
"test:node": "node test.js",
|
|
18
|
+
"lint": "standard"
|
|
12
19
|
},
|
|
13
20
|
"repository": {
|
|
14
21
|
"type": "git",
|