@statezero/core 0.1.54 → 0.1.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
|
@@ -92,8 +92,13 @@ export class Model {
|
|
|
92
92
|
return DateParsingHelpers.serializeDate(value, field, ModelClass.schema);
|
|
93
93
|
}
|
|
94
94
|
// Handle FileObject -> simple file path/data
|
|
95
|
-
|
|
96
|
-
|
|
95
|
+
const fileFormats = ["file-path", "image-path"];
|
|
96
|
+
if (ModelClass.schema?.properties[field]?.format &&
|
|
97
|
+
fileFormats.includes(ModelClass.schema.properties[field].format) &&
|
|
98
|
+
value &&
|
|
99
|
+
typeof value.toJSON === "function") {
|
|
100
|
+
// Return a serializable JSON representation of the FileObject.
|
|
101
|
+
return value.toJSON();
|
|
97
102
|
}
|
|
98
103
|
// Handle Model instances -> primary keys
|
|
99
104
|
if (value &&
|
package/package.json
CHANGED