Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Object.values() in Firebase Cloud Functions

I'm attempting to use Object.values() in one of my Firebase Cloud Functions, but it isn't recognized as a function. I assume this means that es7 functions aren't available on Firebase Cloud Functions. My question is two-fold:

First, is this true? Second, I recognize that the function isn't supported by some browsers, but I wonder if that's important for Firebase Cloud Functions. Can anyone explain this to me?

like image 290
J. Adam Connor Avatar asked Feb 05 '23 19:02

J. Adam Connor


2 Answers

According to node.green, Firebase only supports the LTS version of Node which is currently at the version 6.10.x and Object.values is still behind experimental flag in Node 6.10.x.

Hope this cleared your doubt!

like image 100
motss Avatar answered Feb 07 '23 08:02

motss


Ran into the same issue. check out this answer that recommends using the Object.keys function and chaining it to the built in map function that comes with the array prototype.

like image 41
Tope Avatar answered Feb 07 '23 08:02

Tope