@@ -32,7 +32,12 @@ import * as https from './providers/https';
3232import * as pubsub from './providers/pubsub' ;
3333import * as remoteConfig from './providers/remoteConfig' ;
3434import * as storage from './providers/storage' ;
35- import { CloudFunction , EventContext , Runnable , TriggerAnnotated } from './cloud-functions' ;
35+ import {
36+ CloudFunction ,
37+ EventContext ,
38+ Runnable ,
39+ TriggerAnnotated ,
40+ } from './cloud-functions' ;
3641
3742/**
3843 * Configure the regions that the function is deployed to.
@@ -41,15 +46,15 @@ import { CloudFunction, EventContext, Runnable, TriggerAnnotated } from './cloud
4146 */
4247export function region ( ...regions : string [ ] ) {
4348 if ( ! regions . length ) {
44- throw new Error (
45- "You must specify at least one region"
46- ) ;
49+ throw new Error ( 'You must specify at least one region' ) ;
4750 }
4851 if (
49- _ . difference (
50- regions ,
51- [ 'us-central1' , 'us-east1' , 'europe-west1' , 'asia-northeast1' ]
52- ) . length
52+ _ . difference ( regions , [
53+ 'us-central1' ,
54+ 'us-east1' ,
55+ 'europe-west1' ,
56+ 'asia-northeast1' ,
57+ ] ) . length
5358 ) {
5459 throw new Error (
5560 "The only valid regions are 'us-central1', 'us-east1', 'europe-west1', and 'asia-northeast1'"
@@ -80,11 +85,10 @@ export function runWith(runtimeOptions: {
8085 ) ;
8186 }
8287 if (
83- runtimeOptions . timeoutSeconds > 540 || runtimeOptions . timeoutSeconds < 0
88+ runtimeOptions . timeoutSeconds > 540 ||
89+ runtimeOptions . timeoutSeconds < 0
8490 ) {
85- throw new Error (
86- "TimeoutSeconds must be between 0 and 540"
87- ) ;
91+ throw new Error ( 'TimeoutSeconds must be between 0 and 540' ) ;
8892 }
8993 return new FunctionBuilder ( runtimeOptions ) ;
9094}
@@ -131,11 +135,10 @@ export class FunctionBuilder {
131135 ) ;
132136 }
133137 if (
134- runtimeOptions . timeoutSeconds > 540 || runtimeOptions . timeoutSeconds < 0
138+ runtimeOptions . timeoutSeconds > 540 ||
139+ runtimeOptions . timeoutSeconds < 0
135140 ) {
136- throw new Error (
137- "TimeoutSeconds must be between 0 and 540"
138- ) ;
141+ throw new Error ( 'TimeoutSeconds must be between 0 and 540' ) ;
139142 }
140143 this . options = _ . assign ( this . options , runtimeOptions ) ;
141144 return this ;
0 commit comments