silverwolf-x's picture
download
raw
712 Bytes
import { getBindingsSync } from '../../../build/swc'
import type {
NapiCodeFrameLocation,
NapiCodeFrameOptions,
} from '../../../build/swc/generated-native'
/**
* 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: string,
location: NapiCodeFrameLocation,
options: NapiCodeFrameOptions = {}
): string | undefined {
// Default to the terminal width
if (options.maxWidth === undefined) {
options.maxWidth = process.stdout.columns
}
return getBindingsSync().codeFrameColumns(file, location, options)
}
export type { NapiCodeFrameLocation, NapiCodeFrameOptions }

Xet Storage Details

Size:
712 Bytes
·
Xet hash:
7c54774f1944b7123675cd258e1721d387c61ea163b39e882abbcc014c6439da

Xet efficiently stores files, intelligently splitting them into unique chunks and accelerating uploads and downloads. More info.