firebase-functions
firebase-functions copied to clipboard
Encode Date object in return value of onCall functions
Description
refs: https://github.com/firebase/firebase-functions/issues/988
Encode a Date object in return value of onCall functions to ISO formatted date string.
Code sample
onCall(() => {
return { d: new Date() }
})
The execution result of the above code changes as follows,
Before behavior:
{
"result": {
"d": {}
}
}
After behavior:
{
"result": {
"d": "2021-10-12T13:11:44.977Z"
}
}