MCPcopy Create free account
hub / github.com/firebase/firebase-tools / convertDatabaseInstance

Function convertDatabaseInstance

src/management/database.ts:261–279  ·  view source on GitHub ↗
(serverInstance: any)

Source from the content-addressed store, hash-verified

259
260// eslint-disable-next-line @typescript-eslint/no-explicit-any
261function convertDatabaseInstance(serverInstance: any): DatabaseInstance {
262 if (!serverInstance.name) {
263 throw new FirebaseError(`DatabaseInstance response is missing field "name"`);
264 }
265 const m = serverInstance.name.match(INSTANCE_RESOURCE_NAME_REGEX);
266 if (!m || m.length !== 4) {
267 throw new FirebaseError(
268 `Error parsing instance resource name: ${serverInstance.name}, matches: ${m}`,
269 );
270 }
271 return {
272 name: m[3],
273 location: parseDatabaseLocation(m[2], DatabaseLocation.ANY),
274 project: serverInstance.project,
275 databaseUrl: serverInstance.databaseUrl,
276 type: serverInstance.type,
277 state: serverInstance.state,
278 };
279}

Callers 2

createInstanceFunction · 0.85

Calls 2

parseDatabaseLocationFunction · 0.85
matchMethod · 0.65

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…