Skip to content

Commit

Permalink
Corrected regex for #1055
Browse files Browse the repository at this point in the history
  • Loading branch information
rhodgkins committed Mar 10, 2022
1 parent 39fc092 commit b828ee8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/providers/database.ts
Expand Up @@ -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
*
Expand All @@ -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(
Expand Down

0 comments on commit b828ee8

Please sign in to comment.