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