@hyperlane-xyz/sdk
Version:
The official SDK for the Hyperlane Network
12 lines • 404 B
JavaScript
import fetch from 'cross-fetch';
export async function fetchWithTimeout(resource, options, timeout = 10000) {
const controller = new AbortController();
const id = setTimeout(() => controller.abort(), timeout);
const response = await fetch(resource, {
...options,
signal: controller.signal,
});
clearTimeout(id);
return response;
}
//# sourceMappingURL=fetch.js.map