🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Book a DemoInstallSign in
Socket

loop-detection

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

loop-detection - npm Package Compare versions

Comparing version

to
1.0.1

12

lib/loop_protect.js
function LoopProtect() {
this.counters = {}
this.threshold = 500
}

@@ -16,5 +17,6 @@

// TODO(ibash) make threshold configurable
if ((now - current.time) > 100) {
this.onHitCallback(current)
if ((now - current.time) > this.threshold) {
if (this.onHitCallback) {
this.onHitCallback(current)
}
return true

@@ -26,2 +28,6 @@ }

LoopProtect.prototype.setThreshold = function setThreshold(threshold) {
this.threshold = threshold
}
LoopProtect.prototype.onHit = function onHit(callback) {

@@ -28,0 +34,0 @@ this.onHitCallback = callback

{
"name": "loop-detection",
"version": "1.0.0",
"version": "1.0.1",
"description": "",

@@ -5,0 +5,0 @@ "main": "index.js",