@@ -278,37 +278,43 @@ export type DynamicExtension = {
278278 events : string [ ] ;
279279} ;
280280
281+ interface ResolveBackendOpts {
282+ build : Build ;
283+ firebaseConfig : FirebaseConfig ;
284+ userEnvOpt : UserEnvsOpts ;
285+ userEnvs : Record < string , string > ;
286+ nonInteractive ?: boolean ;
287+ isEmulator ?: boolean ;
288+ }
289+
281290/**
282291 * Resolves user-defined parameters inside a Build, and generates a Backend.
283292 * Returns both the Backend and the literal resolved values of any params, since
284293 * the latter also have to be uploaded so user code can see them in process.env
285294 */
286295export async function resolveBackend (
287- build : Build ,
288- firebaseConfig : FirebaseConfig ,
289- userEnvOpt : UserEnvsOpts ,
290- userEnvs : Record < string , string > ,
291- nonInteractive ?: boolean ,
296+ opts : ResolveBackendOpts ,
292297) : Promise < { backend : backend . Backend ; envs : Record < string , params . ParamValue > } > {
293298 let paramValues : Record < string , params . ParamValue > = { } ;
294299 paramValues = await params . resolveParams (
295- build . params ,
296- firebaseConfig ,
297- envWithTypes ( build . params , userEnvs ) ,
298- nonInteractive ,
300+ opts . build . params ,
301+ opts . firebaseConfig ,
302+ envWithTypes ( opts . build . params , opts . userEnvs ) ,
303+ opts . nonInteractive ,
304+ opts . isEmulator ,
299305 ) ;
300306
301307 const toWrite : Record < string , string > = { } ;
302308 for ( const paramName of Object . keys ( paramValues ) ) {
303309 const paramValue = paramValues [ paramName ] ;
304- if ( Object . prototype . hasOwnProperty . call ( userEnvs , paramName ) || paramValue . internal ) {
310+ if ( Object . prototype . hasOwnProperty . call ( opts . userEnvs , paramName ) || paramValue . internal ) {
305311 continue ;
306312 }
307313 toWrite [ paramName ] = paramValue . toString ( ) ;
308314 }
309- writeUserEnvs ( toWrite , userEnvOpt ) ;
315+ writeUserEnvs ( toWrite , opts . userEnvOpt ) ;
310316
311- return { backend : toBackend ( build , paramValues ) , envs : paramValues } ;
317+ return { backend : toBackend ( opts . build , paramValues ) , envs : paramValues } ;
312318}
313319
314320// Exported for testing
0 commit comments