Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
const maybeFulfillPromise = () => {
if (pageLoaded && Object.keys(pendingRequestURLMap).length === 0) {
if (failedURLs.length !== 0) {
reject(new FetchingURLsError(failedURLs));
} else {
// In some cases such as fonts further requests will only happen after the page has been fully rendered
if (stabilizationTimer) {
clearTimeout(stabilizationTimer);
}
stabilizationTimer = setTimeout(
resolve,
REQUEST_STABILIZATION_TIMEOUT
);
}
}
};