From 9eec4a4915f4aa59d3e3bbe0fcf223d043744e7e Mon Sep 17 00:00:00 2001 From: Rich Hodgkins Date: Thu, 10 Mar 2022 09:38:52 +0000 Subject: [PATCH] Corrected regex for #1055 --- src/providers/database.ts | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/providers/database.ts b/src/providers/database.ts index 53eb9ba12..7108ffb78 100644 --- a/src/providers/database.ts +++ b/src/providers/database.ts @@ -307,6 +307,8 @@ export class RefBuilder { }; } +const resourceRegex = /^projects\/([^/]+)\/instances\/([a-zA-Z0-9-]+?)\/refs(\/.+)?/; + /** * Utility function to extract database reference from resource string * @@ -320,7 +322,6 @@ export function extractInstanceAndPath( resource: string, domain = 'firebaseio.com' ) { - const resourceRegex = `projects/([^/]+)/instances/([a-zA-Z0-9\-^/]+)/refs(/.+)?`; const match = resource.match(new RegExp(resourceRegex)); if (!match) { throw new Error(