Skip to content

Commit 36adb2e

Browse files
authored
Fix get prismaFile() to work with node v18.20.5 (#141)
1 parent e256472 commit 36adb2e

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

gdf.js

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -173,9 +173,9 @@ export class GDF {
173173
const schemaContent = fs.readFileSync(schema, 'utf-8')
174174
const urlMatch = schemaContent.match(/url\s*=\s*"(.*?)"/)
175175
if (!urlMatch) return null
176-
const url = urlMatch[1]
177-
if (url.startsWith('file:.')) return url.slice(5)
178-
if (url.startsWith('file:')) return URL.parse(url).pathname
176+
const dbUrl = urlMatch[1]
177+
if (dbUrl.startsWith('file:.')) return dbUrl.slice(5)
178+
if (dbUrl.startsWith('file:')) return new URL(dbUrl).pathname
179179
}
180180

181181
get prismaEnv() {

0 commit comments

Comments
 (0)