(str)
| 476 | } |
| 477 | |
| 478 | export function normalizeCodeLocInfo(str) { |
| 479 | if (typeof str === 'object' && str !== null) { |
| 480 | str = str.stack; |
| 481 | } |
| 482 | if (typeof str !== 'string') { |
| 483 | return str; |
| 484 | } |
| 485 | // This special case exists only for the special source location in |
| 486 | // ReactElementValidator. That will go away if we remove source locations. |
| 487 | str = str.replace(/Check your code at .+?:\d+/g, 'Check your code at **'); |
| 488 | // V8 format: |
| 489 | // at Component (/path/filename.js:123:45) |
| 490 | // React format: |
| 491 | // in Component (at filename.js:123) |
| 492 | return str.replace(/\n +(?:at|in) ([\S]+)[^\n]*/g, function (m, name) { |
| 493 | return '\n in ' + name + ' (at **)'; |
| 494 | }); |
| 495 | } |
no outgoing calls
no test coverage detected