MCPcopy
hub / github.com/facebook/react / normalizeComponentStack

Function normalizeComponentStack

packages/internal-test-utils/consoleMock.js:171–182  ·  view source on GitHub ↗
(entry)

Source from the content-addressed store, hash-verified

169}
170
171function normalizeComponentStack(entry) {
172 if (
173 typeof entry[0] === 'string' &&
174 entry[0].endsWith('%s') &&
175 isLikelyAComponentStack(entry[entry.length - 1])
176 ) {
177 const clone = entry.slice(0);
178 clone[clone.length - 1] = normalizeCodeLocInfo(entry[entry.length - 1]);
179 return clone;
180 }
181 return entry;
182}
183
184const isLikelyAComponentStack = message =>
185 typeof message === 'string' &&

Callers

nothing calls this directly

Calls 2

isLikelyAComponentStackFunction · 0.70
normalizeCodeLocInfoFunction · 0.70

Tested by

no test coverage detected