@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
18 lines • 732 B
TypeScript
/**
* Returns the first N elements of a string.
* @param {string} string - The string to slice.
* @param {number} [count] - Number of elements to return.
* @returns {string} The first N characters.
* @throws {TypeError} If input is not array-like or count is invalid.
*/
export default function first(string: string, count?: number): string;
/**
* Returns the first N elements of an array.
* @template T
* @param {T[]} array - The array to slice.
* @param {number} [count] - Number of elements to return.
* @returns {T[]} The first N elements.
* @throws {TypeError} If input is not array-like or count is invalid.
*/
export default function first<T>(array: T[], count?: number): T[];
//# sourceMappingURL=first.d.ts.map