Commit 337b47d
authored
BREAKING: Break TS build that uses functions.config() (#1757)
Type out `functions.config()` API. Use of `functions.config()` API should now cause a BUILD error at compile time.
```ts
import * as functions from "firebase-functions";
import {onRequest} from "firebase-functions/https";
import * as logger from "firebase-functions/logger";
const cfg = functions.config()
export const helloWorld = onRequest((request, response) => {
logger.info("Hello logs!", cfg);
response.send("Hello from Firebase!");
});
```
```bash
$ npm run build
> build
> tsc
src/index.ts:5:23 - error TS2349: This expression is not callable.
Type 'never' has no call signatures.
5 const cfg = functions.config()
~~~~~~
Found 1 error in src/index.ts:5
```1 parent 206c838 commit 337b47d
2 files changed
+7
-4
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
26 | 26 | | |
27 | 27 | | |
28 | 28 | | |
29 | | - | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
30 | 33 | | |
31 | 34 | | |
32 | 35 | | |
33 | 36 | | |
34 | 37 | | |
35 | 38 | | |
36 | | - | |
| 39 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
27 | 27 | | |
28 | 28 | | |
29 | 29 | | |
30 | | - | |
| 30 | + | |
31 | 31 | | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
35 | 35 | | |
36 | | - | |
| 36 | + | |
0 commit comments