You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 4-6.RSVP
Socket
Book a DemoInstallSign in
Socket

@snyk/dep-graph

Package Overview
Dependencies
Maintainers
1
Versions
80
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@snyk/dep-graph - npm Package Compare versions

Comparing version

to
1.5.2

3

dist/legacy/event-loop-spinner.d.ts
export declare class EventLoopSpinner {
private thresholdMs;
private lastSpin;
private afterLastSpin;
constructor(thresholdMs?: number);
isStarving(): boolean;
reset(): void;
spin(): Promise<{}>;
}

@@ -8,12 +8,18 @@ "use strict";

this.thresholdMs = thresholdMs;
this.lastSpin = Date.now();
this.afterLastSpin = Date.now();
}
EventLoopSpinner.prototype.isStarving = function () {
return (Date.now() - this.lastSpin) > this.thresholdMs;
return (Date.now() - this.afterLastSpin) > this.thresholdMs;
};
EventLoopSpinner.prototype.reset = function () {
this.afterLastSpin = Date.now();
};
EventLoopSpinner.prototype.spin = function () {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var _this = this;
return tslib_1.__generator(this, function (_a) {
this.lastSpin = Date.now();
return [2 /*return*/, new Promise(function (resolve) { return setImmediate(resolve); })];
return [2 /*return*/, new Promise(function (resolve) { return setImmediate(function () {
_this.reset();
resolve();
}); })];
});

@@ -20,0 +26,0 @@ });

@@ -49,3 +49,3 @@ {

},
"version": "1.5.1"
"version": "1.5.2"
}

Sorry, the diff of this file is not supported yet