UNPKG

everyutil

Version:

A comprehensive library of lightweight, reusable utility functions for JavaScript and TypeScript, designed to streamline common programming tasks such as string manipulation, array processing, date handling, and more.

11 lines (10 loc) 315 B
/** * Collapses multiple spaces and newlines into a single space. * * Example: collapseWhitespace("a b\n\nc") → "a b c" * * @author @dailker * @param {string} str - The input string. * @returns {string} The collapsed string. */ export declare function collapseWhitespace(str: string): string;