Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

re

Package Overview
Dependencies
Maintainers
1
Versions
28
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

re - npm Package Compare versions

Comparing version 0.0.6-7 to 0.0.7-1

13

lib/re.js

@@ -48,3 +48,3 @@ exports.RETRY_STRATEGY = RETRY_STRATEGY = {CONSTANT: 0, EXPONENTIAL: 1, LINEAR: 2};

Re.prototype.try = function(operation, callback){
var fail = this.createFailCallback(operation, callback);
var fail = this.createFailCallback(operation, callback, this.try);

@@ -56,14 +56,13 @@ try{

}
}
};
Re.prototype.do = function(operation, callback){
var fail = this.createFailCallback(operation, callback);
var fail = this.createFailCallback(operation, callback, this.do);
operation(this.retry, fail, callback);
}
};
Re.prototype.createFailCallback = function(operation, callback){
Re.prototype.createFailCallback = function(operation, callback, method){
var self = this;
return function(err){
var fail = self.createFailCallback(operation, callback);

@@ -74,3 +73,3 @@ callback = callback || function () {};

setTimeout(function(){
operation(self.retry, fail, callback);
method.call(self, operation, callback);
},

@@ -77,0 +76,0 @@ self.retryInterval(self.retry));

{
"name": "re",
"description": "Do it again, after a bit.",
"version": "0.0.6-7",
"version": "0.0.7-1",
"main": "./lib/re",

@@ -6,0 +6,0 @@ "keywords": ["utility", "retry", "exponential backoff", "linear backoff"],

@@ -19,3 +19,3 @@ var retry = require('../lib/re');

last = now;
if(retryCount < 10) fail(new Error("Not there yet."));
if(retryCount < 10) throw new Error("Not there yet.");
else callback(null, retryCount);

@@ -22,0 +22,0 @@ },

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