MCPcopy Index your code
hub / github.com/changesets/changesets / getFile

Function getFile

packages/cli/src/commands/version/version.test.ts:85–95  ·  view source on GitHub ↗
(pkgName: string, fileName: string, calls: any)

Source from the content-addressed store, hash-verified

83};
84
85const getFile = (pkgName: string, fileName: string, calls: any) => {
86 let castCalls: [string, string][] = calls;
87 const foundCall = castCalls.find((call) =>
88 call[0].endsWith(`${pkgName}${path.sep}${fileName}`)
89 );
90 if (!foundCall)
91 throw new Error(`could not find writing of ${fileName} for: ${pkgName}`);
92
93 // return written content
94 return foundCall[1];
95};
96
97const getPkgJSON = (pkgName: string, calls: any) => {
98 return JSON.parse(getFile(pkgName, "package.json", calls));

Callers 2

getPkgJSONFunction · 0.85
getChangelogFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected