MCPcopy
hub / github.com/prisma/prisma / getTypescriptVersion

Function getTypescriptVersion

packages/internals/src/cli/getTypescriptVersion.ts:10–20  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

8}
9
10export async function getTypescriptVersion(): Promise<string> {
11 try {
12 // On node.js this will import the project defined typescript package.
13 // On bun this will import the bun bundled typescript package.
14 return (await import('typescript')).default.version
15 } catch (_) {
16 // On deno the dynamic import of typescript will fail but typescript is natively available and its version is available in process.versions.
17 // If none of this worked typescript is likely not installed / available.
18 return (await getProcessObject())?.versions.typescript || 'unknown'
19 }
20}

Callers 1

parseMethod · 0.90

Calls 1

getProcessObjectFunction · 0.85

Tested by

no test coverage detected