Prettier backfill

This commit is contained in:
Matt Rubens
2025-01-17 14:11:28 -05:00
parent 3bcb4ff8c5
commit 60a0a824b9
174 changed files with 15715 additions and 15428 deletions

View File

@@ -1,20 +1,20 @@
function pWaitFor(condition, options = {}) {
return new Promise((resolve, reject) => {
const interval = setInterval(() => {
if (condition()) {
clearInterval(interval);
resolve();
}
}, options.interval || 20);
return new Promise((resolve, reject) => {
const interval = setInterval(() => {
if (condition()) {
clearInterval(interval)
resolve()
}
}, options.interval || 20)
if (options.timeout) {
setTimeout(() => {
clearInterval(interval);
reject(new Error('Timed out'));
}, options.timeout);
}
});
if (options.timeout) {
setTimeout(() => {
clearInterval(interval)
reject(new Error("Timed out"))
}, options.timeout)
}
})
}
module.exports = pWaitFor;
module.exports.default = pWaitFor;
module.exports = pWaitFor
module.exports.default = pWaitFor