@technobuddha/library
Version:
A large library of useful functions
18 lines (17 loc) • 505 B
TypeScript
/**
* Options for the {@link collapseWhitespace} function
* @group String
* @category Operations
*/
export type CollapseWhitespaceOptions = {
/** If true, trim */
trim?: boolean;
};
/**
* Replace all whitespace within a string with a single space
* @param input - The string
* @param trim - If true, remove leading and trailing whitespace
* @group String
* @category Operations
*/
export declare function collapseWhitespace(input: string, { trim }?: CollapseWhitespaceOptions): string;