New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@klasa/event-iterator

Package Overview
Dependencies
Maintainers
5
Versions
11
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@klasa/event-iterator - npm Package Compare versions

Comparing version 0.0.10 to 0.0.11

19

dist/src/index.js

@@ -15,3 +15,3 @@ "use strict";

};
var _ended, _idle, _queue, _passed, _limit;
var _ended, _idle, _queue, _passed, _limit, _idleTimer;
Object.defineProperty(exports, "__esModule", { value: true });

@@ -54,5 +54,12 @@ exports.EventIterator = void 0;

_limit.set(this, void 0);
/**
* The timer to track when this will idle out.
*/
_idleTimer.set(this, null);
__classPrivateFieldSet(this, _limit, (_a = options.limit) !== null && _a !== void 0 ? _a : Infinity);
__classPrivateFieldSet(this, _idle, options.idle);
this.filter = (_b = options.filter) !== null && _b !== void 0 ? _b : (() => true);
// This timer is to idle out on lack of valid responses
if (__classPrivateFieldGet(this, _idle))
__classPrivateFieldSet(this, _idleTimer, timer_manager_1.TimerManager.setTimeout(this.end.bind(this), __classPrivateFieldGet(this, _idle)));
this.push = this.push.bind(this);

@@ -93,9 +100,15 @@ const maxListeners = this.emitter.getMaxListeners();

this.end();
if (__classPrivateFieldGet(this, _idleTimer))
__classPrivateFieldGet(this, _idleTimer).refresh();
return { done: false, value };
}
if (__classPrivateFieldGet(this, _ended))
if (__classPrivateFieldGet(this, _ended)) {
if (__classPrivateFieldGet(this, _idleTimer))
timer_manager_1.TimerManager.clearTimeout(__classPrivateFieldGet(this, _idleTimer));
return { done: true, value: undefined };
}
return new Promise((resolve) => {
let idleTimer;
if (__classPrivateFieldGet(this, _idle)) {
// This timer is to idle out on lack of any responses
idleTimer = timer_manager_1.TimerManager.setTimeout(() => {

@@ -130,3 +143,3 @@ this.end();

*/
[(_ended = new WeakMap(), _idle = new WeakMap(), _queue = new WeakMap(), _passed = new WeakMap(), _limit = new WeakMap(), Symbol.asyncIterator)]() {
[(_ended = new WeakMap(), _idle = new WeakMap(), _queue = new WeakMap(), _passed = new WeakMap(), _limit = new WeakMap(), _idleTimer = new WeakMap(), Symbol.asyncIterator)]() {
return this;

@@ -133,0 +146,0 @@ }

14

package.json
{
"name": "@klasa/event-iterator",
"version": "0.0.10",
"version": "0.0.11",
"description": "Turns event emitter events into async iterators.",

@@ -26,13 +26,13 @@ "main": "dist/src/index.js",

"@klasa/timer-manager": "^0.0.1",
"@klasa/utils": "^0.0.8",
"@types/node": "^14.0.5",
"@klasa/utils": "^0.1.0",
"@types/node": "^14.0.23",
"@typescript-eslint/eslint-plugin": "2.34.0",
"@typescript-eslint/parser": "2.34.0",
"ava": "^3.8.2",
"ava": "^3.10.1",
"eslint": "^6.8.0",
"eslint-config-klasa": "dirigeants/klasa-lint",
"nyc": "^15.0.1",
"nyc": "^15.1.0",
"source-map-support": "^0.5.19",
"typedoc": "^0.17.7",
"typescript": "^3.9.3"
"typedoc": "^0.17.8",
"typescript": "^3.9.7"
},

@@ -39,0 +39,0 @@ "repository": {

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc