MCPcopy Create free account
hub / github.com/alibaba/open-code-review / loadPackageJson

Function loadPackageJson

scripts/install.js:64–73  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

62}
63
64function loadPackageJson() {
65 const pkg = JSON.parse(fs.readFileSync(path.join(packageRoot, "package.json"), "utf8"));
66 if (!pkg.version) {
67 throw new Error("Missing version field in package.json");
68 }
69 if (!pkg.ocrConfig || !pkg.ocrConfig.urlPattern) {
70 throw new Error("Missing ocrConfig.urlPattern in package.json");
71 }
72 return pkg;
73}
74
75function resolveVersion(pkg) {
76 const envVersion = process.env.OCR_VERSION;

Callers 2

mainFunction · 0.85
mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected