@tempots/std

collapseText() function

It cleans up all the whitespaces in the passed value. collapse does the following: - remove trailing/leading whitespaces - within the string, it collapses seqeunces of whitespaces into a single space character For whitespaces in this description, it is intended to be anything that is matched by the regular expression \s.

Signature:

collapseText: (value: string) => string

Parameters

Parameter

Type

Description

value

string

The string to collapse.

Returns: string

The string with all whitespaces collapsed.