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

Function normalizeCodeLocInfo

fixtures/legacy-jsx-runtimes/setupTests.js:41–55  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

39}
40
41function normalizeCodeLocInfo(str) {
42 if (typeof str !== 'string') {
43 return str;
44 }
45 // This special case exists only for the special source location in
46 // ReactElementValidator. That will go away if we remove source locations.
47 str = str.replace(/Check your code at .+?:\d+/g, 'Check your code at **');
48 // V8 format:
49 // at Component (/path/filename.js:123:45)
50 // React format:
51 // in Component (at filename.js:123)
52 return str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function (m, name) {
53 return '\n in ' + name + ' (at **)';
54 });
55}
56
57const createMatcherFor = (consoleMethod, matcherName) =>
58 function matcher(callback, expectedMessages, options = {}) {

Callers 1

consoleSpyFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected