Files
documentation/node_modules/fork-ts-checker-webpack-plugin/lib/utils/async/isPending.js
2024-03-22 03:47:51 +05:30

10 lines
317 B
JavaScript

"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
function isPending(promise, timeout = 100) {
return Promise.race([
promise.then(() => false).catch(() => false),
new Promise((resolve) => setTimeout(() => resolve(true), timeout)),
]);
}
exports.default = isPending;