MCPcopy Index your code
hub / github.com/getsentry/sentry-javascript / getNitroMajorVersion

Function getNitroMajorVersion

packages/nuxt/src/vite/utils.ts:12–24  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

10 * Returns 2 as the default if nitro is not found or the version cannot be determined.
11 */
12export async function getNitroMajorVersion(): Promise<number> {
13 try {
14 const { getPackageInfo } = await import('local-pkg');
15 const info = await getPackageInfo('nitro');
16 if (info?.version) {
17 const major = parseInt(info.version.split('.')[0] ?? '2', 10);
18 return isNaN(major) ? 2 : major;
19 }
20 } catch {
21 // If local-pkg is unavailable or nitro is not found, default to v2
22 }
23 return 2;
24}
25
26/**
27 * Find the default SDK init file for the given type (client or server).

Callers 1

setupFunction · 0.90

Calls

no outgoing calls

Tested by

no test coverage detected