(baseDir: string)
| 27 | } |
| 28 | |
| 29 | function 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 | |
| 41 | const SEED_PATTERN = /seed\s*[:=]\s*['"`]/ |
| 42 |
no test coverage detected