I'm looking to deploy a cloud function where I'm reading from my database. I want to validate a field exists deep in an object so I was trying to use the null propagation operator ?.
Expected Behavior: if a deep key doesn't exist (or anything along the path), the expression below returns undefined.
Example Code: if (doc.data()?.key?.subKey?.subSubKey) { // Do Stuff }
When I deploy, I'm getting an error.
Error: Error occurred while parsing your function triggers.
Clear Problem Statement
Am I doing something stupidly wrong? Are ?. permitted in cloud functions? Its just vanilla JS right?