()
| 50 | } |
| 51 | |
| 52 | function getUserCodeFrame() { |
| 53 | // If we couldn't load dependencies, we can't generate the user trace |
| 54 | /* istanbul ignore next */ |
| 55 | if (!readFileSync || !codeFrameColumns) { |
| 56 | return '' |
| 57 | } |
| 58 | const err = new Error() |
| 59 | const firstClientCodeFrame = err.stack |
| 60 | .split('\n') |
| 61 | .slice(1) // Remove first line which has the form "Error: TypeError" |
| 62 | .find(frame => !frame.includes('node_modules/')) // Ignore frames from 3rd party libraries |
| 63 | |
| 64 | return getCodeFrame(firstClientCodeFrame) |
| 65 | } |
| 66 | |
| 67 | export {getUserCodeFrame} |
no test coverage detected