Skip to content

Commit 1ccb55f

Browse files
committed
Make ResetValue unconstructable.
1 parent dbabd73 commit 1ccb55f

File tree

3 files changed

+9
-3
lines changed

3 files changed

+9
-3
lines changed

src/common/options.ts

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,15 +22,21 @@
2222

2323
/**
2424
* Special configuration type to reset configuration to platform default.
25+
*
2526
* @alpha
2627
*/
2728
export class ResetValue {
2829
toJSON(): null {
2930
return null;
3031
}
32+
// eslint-disable-next-line @typescript-eslint/no-empty-function
33+
private constructor() {}
34+
public static getInstance() {
35+
return new ResetValue();
36+
}
3137
}
3238

3339
/**
3440
* Special configuration value to reset configuration to platform default.
3541
*/
36-
export const RESET_VALUE = new ResetValue();
42+
export const RESET_VALUE = ResetValue.getInstance();

src/v1/function-configuration.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
import { Expression } from "../params";
22
import { ResetValue } from "../common/options";
33

4-
export { RESET_VALUE, ResetValue } from "../common/options";
4+
export { RESET_VALUE } from "../common/options";
55

66
/**
77
* List of all regions supported by Cloud Functions.

src/v2/options.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ import { ParamSpec } from "../params/types";
3333
import { HttpsOptions } from "./providers/https";
3434
import * as logger from "../logger";
3535

36-
export { RESET_VALUE, ResetValue } from "../common/options";
36+
export { RESET_VALUE } from "../common/options";
3737

3838
/**
3939
* List of all regions supported by Cloud Functions v2

0 commit comments

Comments
 (0)