@reddoorla/maintenance 0.54.2 → 0.54.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -1152,11 +1152,15 @@ async function browserAudit(ctx) {
1152
1152
  await runner.close?.();
1153
1153
  }
1154
1154
  }
1155
+ var FETCH_TIMEOUT_MS = 1e4;
1155
1156
  function defaultDiscoverDeps() {
1156
1157
  return {
1157
1158
  fetchText: async (url) => {
1158
1159
  try {
1159
- const res = await fetch(url, { redirect: "follow" });
1160
+ const res = await fetch(url, {
1161
+ redirect: "follow",
1162
+ signal: AbortSignal.timeout(FETCH_TIMEOUT_MS)
1163
+ });
1160
1164
  if (!res.ok) return null;
1161
1165
  return await res.text();
1162
1166
  } catch {
@@ -1257,9 +1261,17 @@ async function defaultBrowserRunner() {
1257
1261
  for (const url of urls) {
1258
1262
  let status;
1259
1263
  try {
1260
- let res = await fetch(url, { method: "HEAD", redirect: "follow" });
1264
+ let res = await fetch(url, {
1265
+ method: "HEAD",
1266
+ redirect: "follow",
1267
+ signal: AbortSignal.timeout(FETCH_TIMEOUT_MS)
1268
+ });
1261
1269
  if (res.status === 405 || res.status === 501) {
1262
- res = await fetch(url, { method: "GET", redirect: "follow" });
1270
+ res = await fetch(url, {
1271
+ method: "GET",
1272
+ redirect: "follow",
1273
+ signal: AbortSignal.timeout(FETCH_TIMEOUT_MS)
1274
+ });
1263
1275
  }
1264
1276
  status = res.status;
1265
1277
  } catch {