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

Function normalizeWs

packages/cli/src/batch-transform.ts:223–225  ·  view source on GitHub ↗

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

(s: string)

Source from the content-addressed store, hash-verified

221
222/** Collapse all whitespace runs (including newlines) to a single space. */
223function normalizeWs(s: string): string {
224 return s.replace(/\s+/g, " ");
225}
226
227/** Check if a JSX element's text content (recursive) contains the given text.
228 * Uses whitespace-normalized comparison because React collapses JSX whitespace

Callers 1

containsTextFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected