mirror of
https://github.com/appium/appium.git
synced 2026-02-10 20:09:49 -06:00
12 lines
225 B
JavaScript
12 lines
225 B
JavaScript
"use strict";
|
|
|
|
var tryNTimes = function (n, fn) {
|
|
if (n <= 0) return;
|
|
return fn().catch(function () {
|
|
return tryNTimes(n - 1, fn);
|
|
});
|
|
};
|
|
|
|
exports.tryNTimes = tryNTimes;
|
|
exports.try3Times = tryNTimes.bind(null, 3);
|