UNPKG

@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

15 lines 554 B
/** * @callback TimesCallback * @param {number} index * @returns {*} */ /** * Calls a callback a specified number of times, passing the index. * @template T * @param {TimesCallback} callback - The callback to call. * @param {number} count - The number of times to call the callback. * @returns {T[]} Array of callback results. * @throws {TypeError} If callback is not a function or count is not a non-negative integer. */ export default function times<T>(callback: (index: number) => T, count: number): T[]; //# sourceMappingURL=times.d.ts.map