Socket
Socket
Sign inDemoInstall

toobusy-js

Package Overview
Dependencies
77
Maintainers
1
Versions
8
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.4.1 to 0.4.2

2

package.json

@@ -5,3 +5,3 @@ {

"homepage": "https://github.com/STRML/node-toobusy",
"version": "0.4.1",
"version": "0.4.2",
"dependencies": {},

@@ -8,0 +8,0 @@ "devDependencies": {

@@ -15,2 +15,5 @@ 'use strict';

});
it('should start automatically', function() {
(toobusy.started()).should.equal(true);
});
});

@@ -22,4 +25,7 @@

});
it('should throw an exception for non-numbers', function() {
(function() { toobusy.maxLag('derp'); }).should.throw(/must be a number/);
});
it('should throw an exception for values < 10', function() {
(function() { toobusy.maxLag(9); }).should.throw;
(function() { toobusy.maxLag(9); }).should.throw(/should be greater than 10/);
});

@@ -38,3 +44,3 @@ it('should be configurable', function() {

it('should throw an exception for values < 16', function() {
(function() { toobusy.interval(15); }).should.throw;
(function() { toobusy.interval(15); }).should.throw(/Interval/);
});

@@ -41,0 +47,0 @@ it('should be configurable', function() {

@@ -49,3 +49,3 @@ 'use strict';

newInterval = Math.round(newInterval);
if(newInterval < 16) throw new Error("Maximum lag should be greater than 16ms.");
if(newInterval < 16) throw new Error("Interval should be greater than 16ms.");

@@ -81,3 +81,3 @@ toobusy.shutdown();

// If an arg was passed, try to set highWater.
if (typeof interval !== "number") throw new Error("MaxLag must be a number.");
if (typeof newLag !== "number") throw new Error("MaxLag must be a number.");
newLag = Math.round(newLag);

@@ -101,2 +101,6 @@ if(newLag < 10) throw new Error("Maximum lag should be greater than 10ms.");

toobusy.started = function() {
return !!checkInterval;
};
/**

@@ -103,0 +107,0 @@ * Private - starts checking lag.

SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc