MCPcopy Create free account
hub / github.com/babel/babel / patchErrorInfo

Function patchErrorInfo

packages/babel-parser/scripts/build-error-info.ts:45–55  ·  view source on GitHub ↗
(filename: string)

Source from the content-addressed store, hash-verified

43}
44
45export function patchErrorInfo(filename: string) {
46 const info = extractErrorInfo(filename);
47 let file = readFileSync(filename, "utf8");
48 file = file.replaceAll("__PatchMe = never &", `__PatchMe =`);
49 file = file.replaceAll(
50 "ErrorInfoCompressed = {}",
51 `ErrorInfoCompressed = ${info}`
52 );
53 file = file.replace("ErrorsObjects[keyof ErrorsObjects]", "never");
54 writeFileSync(filename, file);
55}

Callers 1

buildBabelParserDtsFunction · 0.90

Calls 2

extractErrorInfoFunction · 0.85
replaceMethod · 0.80

Tested by

no test coverage detected