@@ -58,7 +58,10 @@ function assertRuntimeOptionsValid(runtimeOptions: RuntimeOptions): boolean {
5858 `The only valid memory allocation values are: ${ VALID_MEMORY_OPTIONS . join ( ", " ) } `
5959 ) ;
6060 }
61- if ( runtimeOptions . timeoutSeconds > MAX_TIMEOUT_SECONDS || runtimeOptions . timeoutSeconds < 0 ) {
61+ if (
62+ typeof runtimeOptions . timeoutSeconds === "number" &&
63+ ( runtimeOptions . timeoutSeconds > MAX_TIMEOUT_SECONDS || runtimeOptions . timeoutSeconds < 0 )
64+ ) {
6265 throw new Error ( `TimeoutSeconds must be between 0 and ${ MAX_TIMEOUT_SECONDS } ` ) ;
6366 }
6467
@@ -236,7 +239,7 @@ function validateFailurePolicy(policy: any) {
236239 * @param regions list of regions.
237240 * @throws { Error } Regions must be in list of supported regions.
238241 */
239- function assertRegionsAreValid ( regions : string [ ] ) : boolean {
242+ function assertRegionsAreValid ( regions : ( string | Expression < string > | ResetValue ) [ ] ) : boolean {
240243 if ( ! regions . length ) {
241244 throw new Error ( "You must specify at least one region" ) ;
242245 }
@@ -252,7 +255,7 @@ function assertRegionsAreValid(regions: string[]): boolean {
252255 * functions.region('us-east1', 'us-central1')
253256 */
254257export function region (
255- ...regions : Array < ( typeof SUPPORTED_REGIONS ) [ number ] | string >
258+ ...regions : Array < ( typeof SUPPORTED_REGIONS ) [ number ] | string | Expression < string > | ResetValue >
256259) : FunctionBuilder {
257260 if ( assertRegionsAreValid ( regions ) ) {
258261 return new FunctionBuilder ( { regions } ) ;
@@ -294,7 +297,9 @@ export class FunctionBuilder {
294297 * @example
295298 * functions.region('us-east1', 'us-central1')
296299 */
297- region ( ...regions : Array < ( typeof SUPPORTED_REGIONS ) [ number ] | string > ) : FunctionBuilder {
300+ region (
301+ ...regions : Array < ( typeof SUPPORTED_REGIONS ) [ number ] | string | Expression < string > | ResetValue >
302+ ) : FunctionBuilder {
298303 if ( assertRegionsAreValid ( regions ) ) {
299304 this . options . regions = regions ;
300305 return this ;
0 commit comments