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

disyuntor

Package Overview
Dependencies
Maintainers
3
Versions
36
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

disyuntor - npm Package Compare versions

Comparing version 3.4.6 to 3.5.0

lib/Config.d.ts

4

lib/Disyuntor.d.ts

@@ -16,6 +16,6 @@ /// <reference types="node" />

currentCooldown?: number;
readonly timeout: number;
get timeout(): number;
constructor(params: Options.Parameters);
reset(): void;
readonly state: State;
get state(): State;
protect<A, T extends PromiseBuilder<A>>(call: T): Promise<A>;

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

"use strict";
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
return new (P || (P = Promise))(function (resolve, reject) {
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
function step(result) { result.done ? resolve(result.value) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); }
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
step((generator = generator.apply(thisArg, _arguments || [])).next());

@@ -14,6 +15,7 @@ });

Object.defineProperty(exports, "__esModule", { value: true });
exports.DisyuntorError = exports.wrapPromise = exports.wrapCallbackApi = exports.Disyuntor = void 0;
const events_1 = require("events");
const ms_1 = __importDefault(require("ms"));
const DisyuntorError_1 = require("./DisyuntorError");
exports.DisyuntorError = DisyuntorError_1.DisyuntorError;
Object.defineProperty(exports, "DisyuntorError", { enumerable: true, get: function () { return DisyuntorError_1.DisyuntorError; } });
const Timeout_1 = require("./Timeout");

@@ -27,3 +29,2 @@ const defaults = {

};
const timeProps = ['timeout', 'cooldown', 'maxCooldown'];
var State;

@@ -47,8 +48,11 @@ (function (State) {

}
timeProps.forEach(k => {
var v = this.params[k];
if (typeof v === 'string') {
this.params[k] = ms_1.default(v);
}
});
if (typeof this.params.timeout === 'string') {
this.params.timeout = ms_1.default(this.params.timeout);
}
if (typeof this.params.cooldown === 'string') {
this.params.cooldown = ms_1.default(this.params.cooldown);
}
if (typeof this.params.maxCooldown === 'string') {
this.params.maxCooldown = ms_1.default(this.params.maxCooldown);
}
this.reset();

@@ -135,12 +139,17 @@ if (typeof this.params.onTrip === 'function') {

const newArgs = args.slice(0, -1)
.concat((err, ...args) => {
.concat((err, ...cbArgs) => {
if (err) {
return reject(err);
}
resolve(...args);
resolve(cbArgs);
});
call.call(thisParam, ...newArgs);
});
}).then((...args) => {
callback(null, ...args);
}).then((args) => {
if (Array.isArray(args)) {
callback(null, ...args);
}
else {
callback(null, args);
}
}, err => {

@@ -168,2 +177,2 @@ callback(err);

exports.wrapPromise = wrapPromise;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRGlzeXVudG9yLmpzIiwic291cmNlUm9vdCI6IiIsInNvdXJjZXMiOlsiLi4vc3JjL0Rpc3l1bnRvci50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiOzs7Ozs7Ozs7Ozs7O0FBQUEsbUNBQXFDO0FBQ3JDLDRDQUFtQjtBQUduQixxREFBa0Q7QUE4THpDLHlCQTlMQSwrQkFBYyxDQThMQTtBQTdMdkIsdUNBQW9EO0FBR3BELE1BQU0sUUFBUSxHQUFHO0lBQ2YsT0FBTyxFQUFNLElBQUk7SUFDakIsV0FBVyxFQUFFLENBQUM7SUFDZCxRQUFRLEVBQUssS0FBSztJQUNsQixXQUFXLEVBQUUsS0FBSztJQUNsQixPQUFPLEVBQU0sR0FBRyxFQUFFLENBQUMsSUFBSTtDQUN4QixDQUFDO0FBRUYsTUFBTSxTQUFTLEdBQUcsQ0FBQyxTQUFTLEVBQUUsVUFBVSxFQUFFLGFBQWEsQ0FBQyxDQUFDO0FBRXpELElBQUssS0FJSjtBQUpELFdBQUssS0FBSztJQUNSLDBCQUFpQixDQU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sa0NBaUJDIn0=
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DisyuntorError = void 0;
class DisyuntorError extends Error {

@@ -13,2 +14,2 @@ constructor(message, reason) {

exports.DisyuntorError = DisyuntorError;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRGlzeXVudG9yRXJyb3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvRGlzeXVudG9yRXJyb3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7QUFBQSxNQUFhLGNBQWUsU0FBUSxLQUFLO0lBQ3ZDLFlBQ1MsT0FBZSxFQUNmLE1BQWM7UUFDckIsS0FBSyxDQUFDLE9BQU8sQ0FBQyxDQUFDO1FBRlIsWUFBTyxHQUFQLE9BQU8sQ0FBUTtRQUNmLFdBQU0sR0FBTixNQUFNLENBQVE7UUFFckIsTUFBTSxDQUFDLGNBQWMsQ0FBQyxJQUFJLEVBQUUsY0FBYyxDQUFDLFNBQVMsQ0FBQyxDQUFDO1FBQ3RELEtBQUssQ0FBQyxpQkFBaUIsQ0FBQyxJQUFJLEVBQUUsSUFBSSxDQUFDLFdBQVcsQ0FBQyxDQUFBO0lBQ2pELENBQUM7Q0FDRjtBQVJELHdDQVFDIn0=
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiRGlzeXVudG9yRXJyb3IuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi9zcmMvRGlzeXVudG9yRXJyb3IudHMiXSwibmFtZXMiOltdLCJtYXBwaW5ncyI6Ijs7O0FBQUEsTUFBYSxjQUFlLFNBQVEsS0FBSztJQUN2QyxZQUNTLE9BQWUsRUFDZixNQUFjO1FBQ3JCLEtBQUssQ0FBQyxPQUFPLENBQUMsQ0FBQztRQUZSLFlBQU8sR0FBUCxPQUFPLENBQVE7UUFDZixXQUFNLEdBQU4sTUFBTSxDQUFRO1FBRXJCLE1BQU0sQ0FBQyxjQUFjLENBQUMsSUFBSSxFQUFFLGNBQWMsQ0FBQyxTQUFTLENBQUMsQ0FBQztRQUN0RCxLQUFLLENBQUMsaUJBQWlCLENBQUMsSUFBSSxFQUFFLElBQUksQ0FBQyxXQUFXLENBQUMsQ0FBQTtJQUNqRCxDQUFDO0NBQ0Y7QUFSRCx3Q0FRQyJ9

@@ -25,3 +25,3 @@ export declare namespace Options {

* The maximum time the circuit remains open before doing a new attempt.
* Defaults to 60s
* Defaults to 30s
*/

@@ -28,0 +28,0 @@ maxCooldown?: number | string;

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.create = exports.TimeoutError = void 0;
// import Promise from 'bluebird'

@@ -38,2 +39,2 @@ const DisyuntorError_1 = require("./DisyuntorError");

exports.create = create;
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiVGltZW91dC5qcyIsInNvdXJjZVJvb3QiOiIiLCJzb3VyY2VzIjpbIi4uL3NyYy9UaW1lb3V0LnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7O0FBQUEsaUNBQWlDO0FBQ2pDLHFEQUFpRDtBQUVqRCxNQUFhLFlBQWEsU0FBUSwrQkFBYztJQUM5QyxZQUFZLElBQVksRUFBRSxZQUFvQjtRQUM1QyxLQUFLLENBQUMsR0FBRyxJQUFJLDBCQUEwQixZQUFZLGdCQUFnQixFQUFFLFNBQVMsQ0FBQyxDQUFDO1FBQ2hGLE1BQU0sQ0FBQyxjQUFjLENBQUMsSUFBSSxFQUFFLFlBQVksQ0FBQyxTQUFTLENBQUMsQ0FBQztRQUNwRCxLQUFLLENBQUMsaUJBQWlCLENBQUMsSUFBSSxFQUFFLElBQUksQ0FBQyxXQUFXLENBQUMsQ0FBQTtJQUNqRCxDQUFDO0NBQ0Y7QUFORCxvQ0FNQztBQUVELE1BQU0sa0JBQXNCLFNBQVEsT0FBVTtJQUc1QyxZQUFZLFFBQWlIO1FBQzN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UksV0FBVyxHQUFHLElBQUksa0JBQWtCLENBQUksQ0FBQyxRQUFRLEVBQUUsTUFBTSxFQUFFLFFBQVEsRUFBRSxFQUFFO1FBQ3pFLE1BQU0sT0FBTyxHQUFHLFVBQVUsQ0FBQyxHQUFHLEVBQUU7WUFDOUIsTUFBTSxDQUFDLElBQUksWUFBWSxDQUFDLElBQUksRUFBRSxZQUFZLENBQUMsQ0FBQyxDQUFDO1FBQy9DLENBQUMsRUFBRSxZQUFZLENBQUMsQ0FBQztRQUNqQixRQUFRLENBQUMsR0FBRyxFQUFFLENBQUMsWUFBWSxDQUFDLE9BQU8sQ0FBQyxDQUFDLENBQUM7SUFDeEMsQ0FBQyxDQUFDLENBQUM7SUFFSCxNQUFNO1NBQ0gsSUFBSSxDQUFDLEdBQUcsRUFBRSxDQUFDLFdBQVcsQ0FBQyxNQUFNLEVBQUUsQ0FBQztTQUNoQyxLQUFLLENBQUMsR0FBRyxFQUFFLENBQUMsV0FBVyxDQUFDLE1BQU0sRUFBRSxDQUFDLENBQUM7SUFFckMsT0FBTyxXQUFXLENBQUM7QUFDckIsQ0FBQztBQWJELHdCQWFDIn0=
{
"name": "disyuntor",
"description": "A circuit-breaker implementation with exponential backoff.",
"version": "3.4.6",
"version": "3.5.0",
"author": "José F. Romaniello <jfromaniello@gmail.com> (http://joseoncode.com)",

@@ -11,2 +11,3 @@ "repository": {

"main": "./lib/Disyuntor.js",
"types": "./lib/Disyuntor.d.ts",
"scripts": {

@@ -24,3 +25,3 @@ "build": "tsc",

"@types/ms": "^0.7.30",
"@types/node": "^10.9.4",
"@types/node": "^12.9.0",
"async": "~2.1.2",

@@ -33,3 +34,3 @@ "bluebird": "^3.4.7",

"ts-node": "^7.0.1",
"typescript": "^3.0.3"
"typescript": "^4.1.3"
},

@@ -43,3 +44,6 @@ "nyc": {

]
}
},
"files": [
"lib/**/*"
]
}

@@ -85,3 +85,3 @@ [![Build Status](https://travis-ci.org/auth0/disyuntor.svg?branch=master)](https://travis-ci.org/auth0/disyuntor)

const protectedLookup = disyuntor.wrapPromiseApi({
const protectedLookup = disyuntor.wrapPromise({
name: 'dns.lookup',

@@ -88,0 +88,0 @@ timeout: '2s',

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