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

Function normalizeCodeLocInfo

packages/react-dom/src/__tests__/ReactUpdates-test.js:23–34  ·  view source on GitHub ↗
(str)

Source from the content-addressed store, hash-verified

21let assertConsoleErrorDev;
22
23function normalizeCodeLocInfo(str) {
24 return (
25 str &&
26 str.replace(/^ +(?:at|in) ([\S]+)[^\n]*/gm, function (m, name) {
27 const dot = name.lastIndexOf('.');
28 if (dot !== -1) {
29 name = name.slice(dot + 1);
30 }
31 return ' in ' + name + (/\d/.test(m) ? ' (at **)' : '');
32 })
33 );
34}
35
36describe('ReactUpdates', () => {
37 beforeEach(() => {

Callers 5

expectErrorsFunction · 0.70
FooFunction · 0.70
AbortFunction · 0.70

Calls 1

testMethod · 0.45

Tested by

no test coverage detected