MCPcopy Index your code
hub / github.com/callstack/react-native-testing-library / getDefaultNormalizer

Function getDefaultNormalizer

src/matches.ts:37–47  ·  view source on GitHub ↗
({
  trim = true,
  collapseWhitespace = true,
}: NormalizerConfig = {})

Source from the content-addressed store, hash-verified

35};
36
37export function getDefaultNormalizer({
38 trim = true,
39 collapseWhitespace = true,
40}: NormalizerConfig = {}): NormalizerFn {
41 return (text: string) => {
42 let normalizedText = text;
43 normalizedText = trim ? normalizedText.trim() : normalizedText;
44 normalizedText = collapseWhitespace ? normalizedText.replace(/\s+/g, ' ') : normalizedText;
45 return normalizedText;
46 };
47}

Callers 2

matchesFunction · 0.85
text.test.tsxFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…