Project Init

This commit is contained in:
Muluhabt
2026-05-29 15:23:46 +03:00
commit 2fbc557aac
67387 changed files with 6063341 additions and 0 deletions

23
node_modules/es-toolkit/dist/promise/timeout.js generated vendored Normal file
View File

@@ -0,0 +1,23 @@
const require_TimeoutError = require("../error/TimeoutError.js");
const require_delay = require("./delay.js");
//#region src/promise/timeout.ts
/**
* Returns a promise that rejects with a `TimeoutError` after a specified delay.
*
* @param {number} ms - The delay duration in milliseconds.
* @returns {Promise<never>} A promise that rejects with a `TimeoutError` after the specified delay.
* @throws {TimeoutError} Throws a `TimeoutError` after the specified delay.
*
* @example
* try {
* await timeout(1000); // Timeout exception after 1 second
* } catch (error) {
* console.error(error); // Will log 'The operation was timed out'
* }
*/
async function timeout(ms) {
await require_delay.delay(ms);
throw new require_TimeoutError.TimeoutError();
}
//#endregion
exports.timeout = timeout;