@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/cli/bin.js CHANGED
@@ -3621,11 +3621,15 @@ async function browserAudit(ctx) {
3621
3621
  await runner.close?.();
3622
3622
  }
3623
3623
  }
3624
+ var FETCH_TIMEOUT_MS = 1e4;
3624
3625
  function defaultDiscoverDeps() {
3625
3626
  return {
3626
3627
  fetchText: async (url) => {
3627
3628
  try {
3628
- const res = await fetch(url, { redirect: "follow" });
3629
+ const res = await fetch(url, {
3630
+ redirect: "follow",
3631
+ signal: AbortSignal.timeout(FETCH_TIMEOUT_MS)
3632
+ });
3629
3633
  if (!res.ok) return null;
3630
3634
  return await res.text();
3631
3635
  } catch {
@@ -3726,9 +3730,17 @@ async function defaultBrowserRunner() {
3726
3730
  for (const url of urls) {
3727
3731
  let status;
3728
3732
  try {
3729
- let res = await fetch(url, { method: "HEAD", redirect: "follow" });
3733
+ let res = await fetch(url, {
3734
+ method: "HEAD",
3735
+ redirect: "follow",
3736
+ signal: AbortSignal.timeout(FETCH_TIMEOUT_MS)
3737
+ });
3730
3738
  if (res.status === 405 || res.status === 501) {
3731
- res = await fetch(url, { method: "GET", redirect: "follow" });
3739
+ res = await fetch(url, {
3740
+ method: "GET",
3741
+ redirect: "follow",
3742
+ signal: AbortSignal.timeout(FETCH_TIMEOUT_MS)
3743
+ });
3732
3744
  }
3733
3745
  status = res.status;
3734
3746
  } catch {