fix(lint): use globalThis fetch/AbortController in catalog script

This commit is contained in:
davida-ps
2026-02-16 09:00:52 +00:00
committed by David Abutbul
parent d300618a94
commit a2bd598557
@@ -174,11 +174,18 @@ function mergeWithFallbackMetadata(remoteSkills, fallbackSkills) {
}
async function loadRemoteCatalog(indexUrl, timeoutMs) {
const controller = new AbortController();
if (typeof globalThis.fetch !== "function") {
throw new Error("fetch is unavailable in this runtime");
}
if (typeof globalThis.AbortController !== "function") {
throw new Error("AbortController is unavailable in this runtime");
}
const controller = new globalThis.AbortController();
const timeout = setTimeout(() => controller.abort(), timeoutMs);
try {
const response = await fetch(indexUrl, {
const response = await globalThis.fetch(indexUrl, {
method: "GET",
headers: { Accept: "application/json" },
signal: controller.signal,