@utilify/core
Version:
Modern, strongly typed, and safe utility function library for JavaScript and TypeScript. Includes type checking, manipulation of arrays, objects, strings, dates, colors, numbers, regular expressions, and more. Compatible with Browser, Node.js, Deno, and B
14 lines • 476 B
TypeScript
/**
* @callback RetryCallback
* @returns {T}
*/
/**
* Retries a synchronous function a specified number of times.
* @template T
* @param {RetryCallback} callback - The function to retry.
* @param {number} attempts - Number of attempts.
* @returns {T} The result of the function.
* @throws {TypeError|Error} If parameters are invalid or all attempts fail.
*/
export default function retry<T>(callback: () => T, attempts: number): T;
//# sourceMappingURL=retry.d.ts.map