super-utils-plus
Version:
A superior alternative to Lodash with improved performance, TypeScript support, and developer experience
52 lines (51 loc) • 1.16 kB
TypeScript
/**
* Removes leading and trailing whitespace or specified characters from string.
*
* @param string - The string to trim
* @param chars - The characters to trim
* @returns The trimmed string
*
* @example
* ```ts
* trim(' abc ');
* // => 'abc'
*
* trim('-_-abc-_-', '_-');
* // => 'abc'
* ```
*/
export declare function trim(string: string, chars?: string): string;
/**
* Removes leading whitespace or specified characters from string.
*
* @param string - The string to trim
* @param chars - The characters to trim
* @returns The trimmed string
*
* @example
* ```ts
* trimStart(' abc ');
* // => 'abc '
*
* trimStart('-_-abc-_-', '_-');
* // => 'abc-_-'
* ```
*/
export declare function trimStart(string: string, chars?: string): string;
/**
* Removes trailing whitespace or specified characters from string.
*
* @param string - The string to trim
* @param chars - The characters to trim
* @returns The trimmed string
*
* @example
* ```ts
* trimEnd(' abc ');
* // => ' abc'
*
* trimEnd('-_-abc-_-', '_-');
* // => '-_-abc'
* ```
*/
export declare function trimEnd(string: string, chars?: string): string;