Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Can I write cloud functions for firebase both in javaScript and typeScript?

I have already deployed some 4 or 5 functions to firebase using JavaScript. But now I want to use async-await in my 2 functions. So I want to convert these 2 functions to TypeScript. Is it possible? If I change .js to .ts do the other functions work well which are in js

like image 989
Bhaskar Jyoti Dutta Avatar asked Jan 28 '19 02:01

Bhaskar Jyoti Dutta


1 Answers

All JavaScript is valid TypeScript. TypeScript is a superset of JavaScript.

You should be able to simply change you .js files to .ts to see them work immediately. Then, you can add in TypeScript specific code as you see fit.

like image 108
Doug Stevenson Avatar answered Sep 22 '22 13:09

Doug Stevenson