New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
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 1.0.0 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",

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