@klasa/event-iterator
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -51,2 +51,10 @@ /// <reference types="node" /> | ||
/** | ||
* Handles what happens when you break or return from a loop. | ||
*/ | ||
return(): Promise<IteratorResult<V>>; | ||
/** | ||
* Handles what happens when you encounter an error in a loop. | ||
*/ | ||
throw(): Promise<IteratorResult<V>>; | ||
/** | ||
* The symbol allowing EventIterators to be used in for-await-of loops. | ||
@@ -53,0 +61,0 @@ */ |
@@ -104,2 +104,16 @@ "use strict"; | ||
/** | ||
* Handles what happens when you break or return from a loop. | ||
*/ | ||
async return() { | ||
this.end(); | ||
return { done: true, value: undefined }; | ||
} | ||
/** | ||
* Handles what happens when you encounter an error in a loop. | ||
*/ | ||
async throw() { | ||
this.end(); | ||
return { done: true, value: undefined }; | ||
} | ||
/** | ||
* The symbol allowing EventIterators to be used in for-await-of loops. | ||
@@ -106,0 +120,0 @@ */ |
{ | ||
"name": "@klasa/event-iterator", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Turns event emitter events into async iterators.", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
12129
200