New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ts-retry

Package Overview
Dependencies
Maintainers
1
Versions
65
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ts-retry - npm Package Compare versions

Comparing version 1.0.9 to 1.0.10

3

lib/cjs/index.js
"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());

@@ -8,0 +9,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());

@@ -18,3 +19,3 @@ });

describe('Retry', () => {
it('cb works the first time, retry should not re-call it', () => __awaiter(this, void 0, void 0, function* () {
it('cb works the first time, retry should not re-call it', () => __awaiter(void 0, void 0, void 0, function* () {
const callback = sinon.stub();

@@ -24,3 +25,3 @@ yield _1.retry(callback, { delay: 10, maxTry: 10 });

}));
it('work after three times, retry should call it while cb throws exception', () => __awaiter(this, void 0, void 0, function* () {
it('work after three times, retry should call it while cb throws exception', () => __awaiter(void 0, void 0, void 0, function* () {
const callback = sinon.stub();

@@ -32,3 +33,3 @@ callback.onFirstCall().throws('BOOM');

}));
it('always failed, retry should give up after "maxTry"', () => __awaiter(this, void 0, void 0, function* () {
it('always failed, retry should give up after "maxTry"', () => __awaiter(void 0, void 0, void 0, function* () {
const callback = sinon.stub();

@@ -35,0 +36,0 @@ callback.throws('BOOM');

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());

@@ -7,0 +8,0 @@ });

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());

@@ -16,3 +17,3 @@ });

describe('Retry', () => {
it('cb works the first time, retry should not re-call it', () => __awaiter(this, void 0, void 0, function* () {
it('cb works the first time, retry should not re-call it', () => __awaiter(void 0, void 0, void 0, function* () {
const callback = sinon.stub();

@@ -22,3 +23,3 @@ yield retry(callback, { delay: 10, maxTry: 10 });

}));
it('work after three times, retry should call it while cb throws exception', () => __awaiter(this, void 0, void 0, function* () {
it('work after three times, retry should call it while cb throws exception', () => __awaiter(void 0, void 0, void 0, function* () {
const callback = sinon.stub();

@@ -30,3 +31,3 @@ callback.onFirstCall().throws('BOOM');

}));
it('always failed, retry should give up after "maxTry"', () => __awaiter(this, void 0, void 0, function* () {
it('always failed, retry should give up after "maxTry"', () => __awaiter(void 0, void 0, void 0, function* () {
const callback = sinon.stub();

@@ -33,0 +34,0 @@ callback.throws('BOOM');

{
"name": "ts-retry",
"version": "1.0.9",
"version": "1.0.10",
"main": "lib/cjs/index.js",

@@ -12,5 +12,5 @@ "module": "lib/esm/index.js",

"devDependencies": {
"@types/chai": "4.2.3",
"@types/chai": "4.2.4",
"@types/mocha": "^5.2.6",
"@types/node": "12.7.11",
"@types/node": "12.12.5",
"@types/sinon": "7.5.0",

@@ -20,3 +20,3 @@ "@types/sinon-chai": "3.2.3",

"cross-env": "6.0.3",
"mocha": "6.2.1",
"mocha": "6.2.2",
"rimraf": "3.0.0",

@@ -27,3 +27,3 @@ "sinon": "7.5.0",

"ts-node": "8.4.1",
"typescript": "3.6.3"
"typescript": "3.6.4"
},

@@ -30,0 +30,0 @@ "files": [

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