From 001dd23551818bc8d1e4c87ed8e08264824c1f3b Mon Sep 17 00:00:00 2001 From: Sam Ruby Date: Tue, 1 Apr 2025 08:49:01 -0400 Subject: [PATCH] Fix get prismaFile() to work with node v18.20.5 --- gdf.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/gdf.js b/gdf.js index bd63e31..9964ecf 100755 --- a/gdf.js +++ b/gdf.js @@ -173,9 +173,9 @@ export class GDF { const schemaContent = fs.readFileSync(schema, 'utf-8') const urlMatch = schemaContent.match(/url\s*=\s*"(.*?)"/) if (!urlMatch) return null - const url = urlMatch[1] - if (url.startsWith('file:.')) return url.slice(5) - if (url.startsWith('file:')) return URL.parse(url).pathname + const dbUrl = urlMatch[1] + if (dbUrl.startsWith('file:.')) return dbUrl.slice(5) + if (dbUrl.startsWith('file:')) return new URL(dbUrl).pathname } get prismaEnv() {