1// Network helpers used by local_player and other scripts 2export async function fetchWithTimeout(resource, { timeout = 10000, ...options } = {}) { 3 const controller = new AbortController(); 4 const id = setTimeout(() => controller.abort(), timeout); 5 try { 6 const response = await fetch(resource, { ...options, signal: controller.signal }); 7 return response; 8 } finally { 9 clearTimeout(id); 10 } 11} 12 13export default fetchWithTimeout;
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.