normalizeWhitespace()
Collapse repeated whitespace and trim the ends.
Import
Section titled “Import”import { normalizeWhitespace } from "@graphrefly/ts/solutions/reactive-layout";Signature
Section titled “Signature”function normalizeWhitespace(text: string): stringParameters
Section titled “Parameters”| Parameter | Type | Description |
|---|---|---|
text | string | Text to normalize. |
Returns
Section titled “Returns”A whitespace-normalized string.
Example
Section titled “Example”normalizeWhitespace(" hello world ");Source
Section titled “Source”packages/ts/src/solutions/reactive-layout/segment.ts