(
code: string,
loc: {
start: { line: number; column: number }
end: { line: number; column: number }
},
message: string,
)
| 3 | import type babel from '@babel/core' |
| 4 | |
| 5 | export function codeFrameError( |
| 6 | code: string, |
| 7 | loc: { |
| 8 | start: { line: number; column: number } |
| 9 | end: { line: number; column: number } |
| 10 | }, |
| 11 | message: string, |
| 12 | ) { |
| 13 | const frame = codeFrameColumns( |
| 14 | code, |
| 15 | { |
| 16 | start: loc.start, |
| 17 | end: loc.end, |
| 18 | }, |
| 19 | { |
| 20 | highlightCode: true, |
| 21 | message, |
| 22 | }, |
| 23 | ) |
| 24 | |
| 25 | return new Error(frame) |
| 26 | } |
| 27 | |
| 28 | export function cleanId(id: string): string { |
| 29 | // Remove null byte prefix used by Vite/Rollup for virtual modules |
no outgoing calls
no test coverage detected