next
Version:
The React Framework
14 lines (13 loc) • 670 B
JavaScript
import { getBindingsSync } from '../../../build/swc';
/**
* Renders a code frame showing the location of an error in source code.
* Requires native bindings to be installed — throws otherwise.
*/ export function codeFrameColumns(file, location, options = {}) {
// Default to the terminal width. The CLI passes it on when it pipes this
// process's output for the upgrade menu.
if (options.maxWidth === undefined) {
options.maxWidth = process.stdout.columns ?? (Number(process.env.NEXT_PRIVATE_TERMINAL_COLUMNS) || undefined);
}
return getBindingsSync().codeFrameColumns(file, location, options);
}
//# sourceMappingURL=code-frame.js.map