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

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