MCPcopy
hub / github.com/prisma/prisma / checkSeedInPackageJson

Function checkSeedInPackageJson

packages/cli/src/bootstrap/project-state.ts:29–39  ·  view source on GitHub ↗
(baseDir: string)

Source from the content-addressed store, hash-verified

27}
28
29function checkSeedInPackageJson(baseDir: string): boolean {
30 const packageJsonPath = path.join(baseDir, 'package.json')
31 if (!fs.existsSync(packageJsonPath)) return false
32
33 try {
34 const pkg = JSON.parse(fs.readFileSync(packageJsonPath, 'utf-8'))
35 return typeof pkg.prisma?.seed === 'string' && pkg.prisma.seed.trim().length > 0
36 } catch {
37 return false
38 }
39}
40
41const SEED_PATTERN = /seed\s*[:=]\s*['"`]/
42

Callers 1

checkSeedScriptFunction · 0.85

Calls 1

parseMethod · 0.65

Tested by

no test coverage detected