uawdijnntqw1x1x1
IP : 216.73.216.86
Hostname : 6.87.74.97.host.secureserver.net
Kernel : Linux 6.87.74.97.host.secureserver.net 4.18.0-553.83.1.el8_10.x86_64 #1 SMP Mon Nov 10 04:22:44 EST 2025 x86_64
Disable Function : None :)
OS : Linux
PATH:
/
home
/
emeraadmin
/
www
/
node_modules
/
lodash.isinteger
/
..
/
make-iterator
/
..
/
..
/
4d695
/
promise-retry.zip
/
/
PK�X�\J�~���package.jsonnu�[���{ "_id": "promise-retry@2.0.1", "_inBundle": true, "_location": "/npm/promise-retry", "_phantomChildren": {}, "_requiredBy": [ "/npm/@npmcli/git", "/npm/@sigstore/sign", "/npm/make-fetch-happen", "/npm/pacote" ], "author": { "name": "IndigoUnited", "email": "hello@indigounited.com", "url": "http://indigounited.com" }, "bugs": { "url": "https://github.com/IndigoUnited/node-promise-retry/issues/" }, "dependencies": { "err-code": "^2.0.2", "retry": "^0.12.0" }, "description": "Retries a function that returns a promise, leveraging the power of the retry module.", "devDependencies": { "expect.js": "^0.3.1", "mocha": "^8.0.1", "sleep-promise": "^8.0.1" }, "engines": { "node": ">=10" }, "homepage": "https://github.com/IndigoUnited/node-promise-retry#readme", "keywords": [ "retry", "promise", "backoff", "repeat", "replay" ], "license": "MIT", "main": "index.js", "name": "promise-retry", "repository": { "type": "git", "url": "git://github.com/IndigoUnited/node-promise-retry.git" }, "scripts": { "test": "mocha --bail -t 10000" }, "version": "2.0.1" } PK�X�\������test/test.jsnu�[���'use strict'; var expect = require('expect.js'); var promiseRetry = require('../'); var promiseDelay = require('sleep-promise'); describe('promise-retry', function () { it('should call fn again if retry was called', function () { var count = 0; return promiseRetry(function (retry) { count += 1; return promiseDelay(10) .then(function () { if (count <= 2) { retry(new Error('foo')); } return 'final'; }); }, { factor: 1 }) .then(function (value) { expect(value).to.be('final'); expect(count).to.be(3); }, function () { throw new Error('should not fail'); }); }); it('should call fn with the attempt number', function () { var count = 0; return promiseRetry(function (retry, number) { count += 1; expect(count).to.equal(number); return promiseDelay(10) .then(function () { if (count <= 2) { retry(new Error('foo')); } return 'final'; }); }, { factor: 1 }) .then(function (value) { expect(value).to.be('final'); expect(count).to.be(3); }, function () { throw new Error('should not fail'); }); }); it('should not retry on fulfillment if retry was not called', function () { var count = 0; return promiseRetry(function () { count += 1; return promiseDelay(10) .then(function () { return 'final'; }); }) .then(function (value) { expect(value).to.be('final'); expect(count).to.be(1); }, function () { throw new Error('should not fail'); }); }); it('should not retry on rejection if retry was not called', function () { var count = 0; return promiseRetry(function () { count += 1; return promiseDelay(10) .then(function () { throw new Error('foo'); }); }) .then(function () { throw new Error('should not succeed'); }, function (err) { expect(err.message).to.be('foo'); expect(count).to.be(1); }); }); it('should not retry on rejection if nr of retries is 0', function () { var count = 0; return promiseRetry(function (retry) { count += 1; return promiseDelay(10) .then(function () { throw new Error('foo'); }) .catch(retry); }, { retries : 0 }) .then(function () { throw new Error('should not succeed'); }, function (err) { expect(err.message).to.be('foo'); expect(count).to.be(1); }); }); it('should reject the promise if the retries were exceeded', function () { var count = 0; return promiseRetry(function (retry) { count += 1; return promiseDelay(10) .then(function () { throw new Error('foo'); }) .catch(retry); }, { retries: 2, factor: 1 }) .then(function () { throw new Error('should not succeed'); }, function (err) { expect(err.message).to.be('foo'); expect(count).to.be(3); }); }); it('should pass options to the underlying retry module', function () { var count = 0; return promiseRetry(function (retry) { return promiseDelay(10) .then(function () { if (count < 2) { count += 1; retry(new Error('foo')); } return 'final'; }); }, { retries: 1, factor: 1 }) .then(function () { throw new Error('should not succeed'); }, function (err) { expect(err.message).to.be('foo'); }); }); it('should convert direct fulfillments into promises', function () { return promiseRetry(function () { return 'final'; }, { factor: 1 }) .then(function (value) { expect(value).to.be('final'); }, function () { throw new Error('should not fail'); }); }); it('should convert direct rejections into promises', function () { promiseRetry(function () { throw new Error('foo'); }, { retries: 1, factor: 1 }) .then(function () { throw new Error('should not succeed'); }, function (err) { expect(err.message).to.be('foo'); }); }); it('should not crash on undefined rejections', function () { return promiseRetry(function () { throw undefined; }, { retries: 1, factor: 1 }) .then(function () { throw new Error('should not succeed'); }, function (err) { expect(err).to.be(undefined); }) .then(function () { return promiseRetry(function (retry) { retry(); }, { retries: 1, factor: 1 }); }) .then(function () { throw new Error('should not succeed'); }, function (err) { expect(err).to.be(undefined); }); }); it('should retry if retry() was called with undefined', function () { var count = 0; return promiseRetry(function (retry) { count += 1; return promiseDelay(10) .then(function () { if (count <= 2) { retry(); } return 'final'; }); }, { factor: 1 }) .then(function (value) { expect(value).to.be('final'); expect(count).to.be(3); }, function () { throw new Error('should not fail'); }); }); it('should work with several retries in the same chain', function () { var count = 0; return promiseRetry(function (retry) { count += 1; return promiseDelay(10) .then(function () { retry(new Error('foo')); }) .catch(function (err) { retry(err); }); }, { retries: 1, factor: 1 }) .then(function () { throw new Error('should not succeed'); }, function (err) { expect(err.message).to.be('foo'); expect(count).to.be(2); }); }); it('should allow options to be passed first', function () { var count = 0; return promiseRetry({ factor: 1 }, function (retry) { count += 1; return promiseDelay(10) .then(function () { if (count <= 2) { retry(new Error('foo')); } return 'final'; }); }).then(function (value) { expect(value).to.be('final'); expect(count).to.be(3); }, function () { throw new Error('should not fail'); }); }); }); PK�X�\�b�� LICENSEnu�[���Copyright (c) 2014 IndigoUnited Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. PK�X�\��4�bbindex.jsnu�[���'use strict'; var errcode = require('err-code'); var retry = require('retry'); var hasOwn = Object.prototype.hasOwnProperty; function isRetryError(err) { return err && err.code === 'EPROMISERETRY' && hasOwn.call(err, 'retried'); } function promiseRetry(fn, options) { var temp; var operation; if (typeof fn === 'object' && typeof options === 'function') { // Swap options and fn when using alternate signature (options, fn) temp = options; options = fn; fn = temp; } operation = retry.operation(options); return new Promise(function (resolve, reject) { operation.attempt(function (number) { Promise.resolve() .then(function () { return fn(function (err) { if (isRetryError(err)) { err = err.retried; } throw errcode(new Error('Retrying'), 'EPROMISERETRY', { retried: err }); }, number); }) .then(resolve, function (err) { if (isRetryError(err)) { err = err.retried; if (operation.retry(err || new Error())) { return; } } reject(err); }); }); }); } module.exports = promiseRetry; PK�X�\J�~���package.jsonnu�[���PK�X�\�������test/test.jsnu�[���PK�X�\�b�� "LICENSEnu�[���PK�X�\��4�bbY&index.jsnu�[���PK'�+
/home/emeraadmin/www/node_modules/lodash.isinteger/../make-iterator/../../4d695/promise-retry.zip