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

Function getPackageVersionAtRef

scripts/utils/git.ts:18–28  ·  view source on GitHub ↗
(
  ref: string,
  packageJsonPath: string,
)

Source from the content-addressed store, hash-verified

16}
17
18function getPackageVersionAtRef(
19 ref: string,
20 packageJsonPath: string,
21): string | null {
22 try {
23 let content = execGit(["show", `${ref}:${packageJsonPath}`]);
24 return parseVersionFromPackageJson(content);
25 } catch {
26 return null;
27 }
28}
29
30/**
31 * Finds the commit that introduced a specific version in a package.json file.

Callers 1

Calls 2

execGitFunction · 0.85

Tested by

no test coverage detected