refactor: Add option to convert Parse.Object to instance in Cloud Function payload (#8656)
This commit is contained in:
@@ -255,7 +255,16 @@ function inject(t, list) {
|
||||
props.push(t.objectProperty(t.stringLiteral('action'), action));
|
||||
}
|
||||
if (elt.defaultValue) {
|
||||
const parsedValue = parseDefaultValue(elt, elt.defaultValue, t);
|
||||
let parsedValue = parseDefaultValue(elt, elt.defaultValue, t);
|
||||
if (!parsedValue) {
|
||||
for (const type of elt.typeAnnotation.types) {
|
||||
elt.type = type.type;
|
||||
parsedValue = parseDefaultValue(elt, elt.defaultValue, t);
|
||||
if (parsedValue) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (parsedValue) {
|
||||
props.push(t.objectProperty(t.stringLiteral('default'), parsedValue));
|
||||
} else {
|
||||
|
||||
Reference in New Issue
Block a user