Download node_modules/@aws-sdk/fetch-http-handler/dist-es/request-timeout.js from sweet2004/bot: direct link, hf CLI and curl.
- Browser
- Download file 394 Bytes
-
https://huggingface.co/spaces/sweet2004/bot/resolve/main/node_modules/%40aws-sdk/fetch-http-handler/dist-es/request-timeout.js
- Command line
-
hf download hf://spaces/sweet2004/bot/node_modules/@aws-sdk/fetch-http-handler/dist-es/request-timeout.js
-
curl -L -o request-timeout.js https://huggingface.co/spaces/sweet2004/bot/resolve/main/node_modules/%40aws-sdk/fetch-http-handler/dist-es/request-timeout.js
394 Bytes
| export function requestTimeout(timeoutInMs = 0) { | |
| return new Promise((resolve, reject) => { | |
| if (timeoutInMs) { | |
| setTimeout(() => { | |
| const timeoutError = new Error(`Request did not complete within ${timeoutInMs} ms`); | |
| timeoutError.name = "TimeoutError"; | |
| reject(timeoutError); | |
| }, timeoutInMs); | |
| } | |
| }); | |
| } | |