


//#region src/utils/fetch.ts
async function fetchWithTimeout(fetch, url, init) {
	const abortController = new AbortController();
	const timeoutMs = init?.timeoutMs ?? 5e3;
	const timeout = setTimeout(() => abortController.abort(), timeoutMs);
	try {
		return await fetch(url, {
			...init,
			signal: abortController.signal
		});
	} finally {
		clearTimeout(timeout);
	}
}

//#endregion
exports.fetchWithTimeout = fetchWithTimeout;