Skip to content
PACKAGES

normalizeWhitespace()

Collapse repeated whitespace and trim the ends.

import { normalizeWhitespace } from "@graphrefly/ts/solutions/reactive-layout";
function normalizeWhitespace(text: string): string
ParameterTypeDescription
textstringText to normalize.

A whitespace-normalized string.

normalizeWhitespace(" hello world ");

packages/ts/src/solutions/reactive-layout/segment.ts