MCPcopy Index your code
hub / github.com/remix-run/react-router / parseVersionFromPackageJson

Function parseVersionFromPackageJson

scripts/utils/git.ts:9–16  ·  view source on GitHub ↗
(content: string)

Source from the content-addressed store, hash-verified

7}
8
9function parseVersionFromPackageJson(content: string): string | null {
10 try {
11 let parsed = JSON.parse(content) as Record<string, unknown>;
12 return typeof parsed.version === "string" ? parsed.version : null;
13 } catch {
14 return null;
15 }
16}
17
18function getPackageVersionAtRef(
19 ref: string,

Callers 1

getPackageVersionAtRefFunction · 0.85

Calls 1

parseMethod · 0.80

Tested by

no test coverage detected