MCPcopy
hub / github.com/di-sukharev/opencommit / fetchWithTimeout

Method fetchWithTimeout

out/cli.cjs:69794–69802  ·  view source on GitHub ↗
(url2, init, ms, controller)

Source from the content-addressed store, hash-verified

69792 return `${encodeURIComponent(key)}=${encodeURIComponent(value)}`;
69793 }
69794 if (value === null) {
69795 return `${encodeURIComponent(key)}=`;
69796 }
69797 throw new AnthropicError(`Cannot stringify type ${typeof value}; Expected string, number, boolean, or null. If you need to pass nested query parameters, you can manually encode them, e.g. { query: { 'foo[key1]': value1, 'foo[key2]': value2 } }, and please open a GitHub issue requesting better support for your use case.`);
69798 }).join("&");
69799 }
69800 async fetchWithTimeout(url2, init, ms, controller) {
69801 const { signal, ...options } = init || {};
69802 if (signal)
69803 signal.addEventListener("abort", () => controller.abort());
69804 const timeout = setTimeout(() => controller.abort(), ms);
69805 return this.getRequestClient().fetch.call(void 0, url2, { signal: controller.signal, ...options }).finally(() => {

Callers 1

makeRequestMethod · 0.80

Calls 5

setTimeoutFunction · 0.85
clearTimeoutFunction · 0.85
finallyMethod · 0.80
getRequestClientMethod · 0.80
abortMethod · 0.45

Tested by

no test coverage detected