{"version":3,"sources":["../../../../../src/shared/lib/errors/code-frame.ts"],"sourcesContent":["import { getBindingsSync } from '../../../build/swc'\nimport type {\n  NapiCodeFrameLocation,\n  NapiCodeFrameOptions,\n} from '../../../build/swc/generated-native'\n\n/**\n * Renders a code frame showing the location of an error in source code.\n * Requires native bindings to be installed — throws otherwise.\n */\nexport function codeFrameColumns(\n  file: string,\n  location: NapiCodeFrameLocation,\n  options: NapiCodeFrameOptions = {}\n): string | undefined {\n  // Default to the terminal width\n  if (options.maxWidth === undefined) {\n    options.maxWidth = process.stdout.columns\n  }\n  return getBindingsSync().codeFrameColumns(file, location, options)\n}\n\nexport type { NapiCodeFrameLocation, NapiCodeFrameOptions }\n"],"names":["getBindingsSync","codeFrameColumns","file","location","options","maxWidth","undefined","process","stdout","columns"],"mappings":"AAAA,SAASA,eAAe,QAAQ,qBAAoB;AAMpD;;;CAGC,GACD,OAAO,SAASC,iBACdC,IAAY,EACZC,QAA+B,EAC/BC,UAAgC,CAAC,CAAC;IAElC,gCAAgC;IAChC,IAAIA,QAAQC,QAAQ,KAAKC,WAAW;QAClCF,QAAQC,QAAQ,GAAGE,QAAQC,MAAM,CAACC,OAAO;IAC3C;IACA,OAAOT,kBAAkBC,gBAAgB,CAACC,MAAMC,UAAUC;AAC5D","ignoreList":[0]}