INNER CODE UNIT · JavaScript

joinUrl

WJZ-P/gemini-skill · src/atlas-provider.js:11

function joinUrl(baseUrl, path) {
  return `${baseUrl.replace(/\/+$/, '')}${path}`;
}

async function parseJsonSafely(response) {
  const raw = await response.text();
  try {
    return { raw, data: JSON.parse(raw) };
  } catch {
    return { raw, data: null };
  }
}

async function atlasRequest(path, { apiKey, method = 'GET', body, timeoutMs } = {}) {
  const finalApiKey = resolveApiKey(apiKey);
  const controller = new AbortController();
  const timer = setTimeout(() => controller.abort(), timeoutMs ?? config.atlasRequestTimeoutMs);

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…