made-data-converters
Version:
This package includes:
26 lines (25 loc) • 1.02 kB
TypeScript
/**
* Truncates a string value to the specified length with an ellipsis.
* @param {string} value - The value to truncate.
* @param {number} maxLength - The maximum length of the value.
* @return {string} A truncated string with ellipsis if the value's length is greater than the max length.
*/
export declare function truncate(value: string, maxLength: number): string;
/**
* Converts a string value to a number value.
* @param {string} value - The string value to convert.
* @return {number} The converted value as a number.
*/
export declare function toNumber(value: string): number;
/**
* Converts a string value to a boolean value.
* @param {string} value - The string value to convert.
* @return {boolean} The converted value as a boolean.
*/
export declare function toBoolean(value: string): boolean;
/**
* Reverses a string value.
* @param {string} value - The string value to reverse.
* @return {string} The reversed string value.
*/
export declare function reverseString(value: string): string;