tryloop
Version:
Simple library for retrying operations, it supports multiple backoff strategies.
19 lines (18 loc) • 439 B
JavaScript
/* IMPORT */
/* MAIN */
const isFunction = (value) => {
return typeof value === 'function';
};
const isPromise = (value) => {
return value instanceof Promise;
};
const isUndefined = (value) => {
return typeof value === 'undefined';
};
const makeOptions = (options) => {
if (isFunction(options))
return { fn: options };
return options;
};
/* EXPORT */
export { isFunction, isPromise, isUndefined, makeOptions };