Skip to content

Commit c7a09d5

Browse files
committed
Allow one region per function (#211)
1 parent 3fef83a commit c7a09d5

File tree

2 files changed

+19
-19
lines changed

2 files changed

+19
-19
lines changed

spec/function-builder.spec.ts

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -42,17 +42,17 @@ describe('FunctionBuilder', () => {
4242
expect(fn.__trigger.regions).to.deep.equal(['my-region']);
4343
});
4444

45-
it('should allow multiple regions to be set', () => {
46-
let fn = functions
47-
.region('my-region', 'my-other-region')
48-
.auth.user()
49-
.onCreate(user => user);
50-
51-
expect(fn.__trigger.regions).to.deep.equal([
52-
'my-region',
53-
'my-other-region',
54-
]);
55-
});
45+
// it('should allow multiple regions to be set', () => {
46+
// let fn = functions
47+
// .region('my-region', 'my-other-region')
48+
// .auth.user()
49+
// .onCreate(user => user);
50+
51+
// expect(fn.__trigger.regions).to.deep.equal([
52+
// 'my-region',
53+
// 'my-other-region',
54+
// ]);
55+
// });
5656

5757
it('should allow runtime options to be set', () => {
5858
let fn = functions

src/function-builder.ts

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -35,11 +35,11 @@ import { HttpsFunction } from './cloud-functions';
3535

3636
/**
3737
* Configure the regions that the function is deployed to.
38-
* @param regions One or more parameters indicating the regions.
39-
* For example: `functions.region('us-central1', 'us-east1')`
38+
* @param region Region string.
39+
* For example: `functions.region('us-east1')`
4040
*/
41-
export function region(...regions: string[]) {
42-
return new FunctionBuilder({ regions });
41+
export function region(region: string) {
42+
return new FunctionBuilder({ regions: [region] });
4343
}
4444

4545
/**
@@ -78,11 +78,11 @@ export class FunctionBuilder {
7878

7979
/**
8080
* Configure the regions that the function is deployed to.
81-
* @param regions One or more parameters indicating the region.
82-
* For example: `functions.region('us-central1', 'us-east1')`
81+
* @param region Region string.
82+
* For example: `functions.region('us-east1')`
8383
*/
84-
region = (...regions: string[]) => {
85-
this.options.regions = regions;
84+
region = (region: string) => {
85+
this.options.regions = [region];
8686
return this;
8787
};
8888

0 commit comments

Comments
 (0)