From a4b50e3fbe61cd664648590546f7ad47d015f95d Mon Sep 17 00:00:00 2001 From: Dominik Ferber Date: Thu, 7 Dec 2023 10:48:59 +0200 Subject: [PATCH] fix postgres-connection-string formatting --- packages/postgres/src/postgres-connection-string.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/packages/postgres/src/postgres-connection-string.ts b/packages/postgres/src/postgres-connection-string.ts index 355178636..a5fd8ea59 100644 --- a/packages/postgres/src/postgres-connection-string.ts +++ b/packages/postgres/src/postgres-connection-string.ts @@ -42,7 +42,10 @@ export function isLocalhostConnectionString(connectionString: string): boolean { try { // This seems silly, but we can use all of the hard work put into URL parsing // if we just convert `postgresql://` to `https://` and then parse it as a URL. - const withHttpsProtocol = connectionString.replace(/^postgresql:\/\//, 'https://'); + const withHttpsProtocol = connectionString.replace( + /^postgresql:\/\//, + 'https://', + ); return new URL(withHttpsProtocol).hostname === 'localhost'; } catch (err) { if (err instanceof TypeError) {