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

9 lines 404 B
/** * Truncates a string to a specified length and adds ellipsis. * @param {string} text - The string to truncate. * @param {number} size - The maximum length of the truncated string. * @returns {string} The truncated string with ellipsis. * @throws {TypeError} If text is not a string. */ export default function truncate(text: string, size: number): string; //# sourceMappingURL=truncate.d.ts.map