diff --git a/src/providers/database.ts b/src/providers/database.ts index 53eb9ba12..e5f4d8ed3 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(