(options: any)
| 15 | * @return void promise. |
| 16 | */ |
| 17 | export async function requireDatabaseInstance(options: any): Promise<void> { |
| 18 | if (options.instance) { |
| 19 | return; |
| 20 | } |
| 21 | let instance; |
| 22 | try { |
| 23 | instance = await getDefaultDatabaseInstance(options.project); |
| 24 | } catch (err: unknown) { |
| 25 | throw new FirebaseError(`Failed to get details for project: ${options.project}.`, { |
| 26 | original: getError(err), |
| 27 | }); |
| 28 | } |
| 29 | if (instance === "") { |
| 30 | throw new FirebaseError(MISSING_DEFAULT_INSTANCE_ERROR_MESSAGE); |
| 31 | } |
| 32 | options.instance = instance; |
| 33 | } |
no test coverage detected
searching dependent graphs…