Files
discord-clone/node_modules/vite-plugin-checker/dist/esm/codeFrame.js
2023-01-03 09:29:04 -06:00

22 lines
580 B
JavaScript

import os from "os";
import { codeFrameColumns } from "@babel/code-frame";
function createFrame({
source,
location
}) {
const frame = codeFrameColumns(source, location, {
highlightCode: true
}).split("\n").map((line) => " " + line).join(os.EOL);
return frame;
}
function tsLocationToBabelLocation(tsLoc) {
return {
start: { line: tsLoc.start.line + 1, column: tsLoc.start.character + 1 },
end: { line: tsLoc.end.line + 1, column: tsLoc.end.character + 1 }
};
}
export {
createFrame,
tsLocationToBabelLocation
};
//# sourceMappingURL=codeFrame.js.map