MCPcopy Create free account
hub / github.com/donghaxkim/react-rewrite / normalizeWs

Function normalizeWs

packages/cli/src/transform.ts:1291–1293  ·  view source on GitHub ↗

Collapse all whitespace runs (including newlines) to a single space.

(s: string)

Source from the content-addressed store, hash-verified

1289 */
1290/** Collapse all whitespace runs (including newlines) to a single space. */
1291function normalizeWs(s: string): string {
1292 return s.replace(/\s+/g, " ");
1293}
1294
1295function collapseRenderedWhitespace(value: string): string {
1296 return value.replace(/[\t\n\f\r ]+/g, " ");

Callers 2

mutateTextContentFunction · 0.70
getElementTextNormalizedFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected