ShareCopy to ClipboardRawPreviewconst compactWhitespace = (str: string) => str.replace(/\s{2,}/g, ' '); Compact whitespace00gioyikCodiga's TypeScript RecipesCompacts whitespaces in a string.0 CommentsAdd CommentLog in to add a comment