Download node_modules/@aws-sdk/fetch-http-handler/dist-cjs/request-timeout.js from sweet2004/bot: direct link, hf CLI and curl.
- Browser
- Download file 538 Bytes
-
https://huggingface.co/spaces/sweet2004/bot/resolve/main/node_modules/%40aws-sdk/fetch-http-handler/dist-cjs/request-timeout.js
- Command line
-
hf download hf://spaces/sweet2004/bot/node_modules/@aws-sdk/fetch-http-handler/dist-cjs/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-cjs/request-timeout.js
538 Bytes
| ; | |
| Object.defineProperty(exports, "__esModule", { value: true }); | |
| exports.requestTimeout = void 0; | |
| 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); | |
| } | |
| }); | |
| } | |
| exports.requestTimeout = requestTimeout; | |