xxxxxxxxxx
def is_possibly_undefined(value):
return value is None or isinstance(value, Undefined)
# Usage example
my_var = None
print(is_possibly_undefined(my_var))
xxxxxxxxxx
const data = change?.after?.data() || {};
// create default empty value
xxxxxxxxxx
if(typeof obj === 'undefined') {
// Object is possibly undefined
console.log("Object is undefined");
} else {
// Object is defined
console.log("Object is defined");
}