Skip to content

Commit

Permalink
chore: update build dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
petey committed Oct 31, 2020
1 parent b9e0e26 commit 9bc77cb
Show file tree
Hide file tree
Showing 6 changed files with 2,253 additions and 3,338 deletions.
6 changes: 5 additions & 1 deletion .eslintrc
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
{
"extends": "screwdriver"
"extends": "airbnb-base",
"rules": {
"max-len": ["error", { "ignoreComments": true }],
"indent": ["error", 4]
}
}
17 changes: 7 additions & 10 deletions index.js
Original file line number Diff line number Diff line change
@@ -1,11 +1,9 @@
'use strict';

// Copyright 2015 Yahoo Inc.
// Licensed under the MIT license.
// See the included LICENSE file for terms.

const retry = require('retry');
const joi = require('@hapi/joi');
const joi = require('joi');

/**
* Executes retry operation
Expand All @@ -17,9 +15,8 @@ const joi = require('@hapi/joi');
function execRetry(config, callback) {
const c = config;

c.shouldRetry =
c.shouldRetry ||
function shouldRetry() {
c.shouldRetry = c.shouldRetry
|| function shouldRetry() {
return true;
};
c.options = c.options || {};
Expand All @@ -38,7 +35,7 @@ function execRetry(config, callback) {
return;
}

callback.apply(null, args);
callback(...args);
});

c.method.apply(c.context, attemptArgs);
Expand All @@ -63,13 +60,13 @@ function validateRetry(config, callback) {
factor: joi.number().optional(),
minTimeout: joi.number().optional(),
maxTimeout: joi.number().optional(),
randomize: joi.boolean().optional()
randomize: joi.boolean().optional(),
})
.optional(),
context: joi.object().optional(),
arguments: joi.array().optional(),
shouldRetry: joi.func().optional(),
method: joi.func().required()
method: joi.func().required(),
})
.required();

Expand All @@ -81,7 +78,7 @@ function validateRetry(config, callback) {

if (result.error) {
throw new Error(
result.error.details.map(detail => detail.message).join(',')
result.error.details.map((detail) => detail.message).join(','),
);
}

Expand Down
Loading

0 comments on commit 9bc77cb

Please sign in to comment.