@statezero/core 0.1.47 → 0.1.49
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.
|
@@ -59,6 +59,13 @@ export class FileObject {
|
|
|
59
59
|
`Provided: ${this.chunkSize / (1024 * 1024)}MB`);
|
|
60
60
|
}
|
|
61
61
|
this.maxConcurrency = options.maxConcurrency || 3;
|
|
62
|
+
// This is to make the fileObject serializable by IDB in the cache
|
|
63
|
+
Object.defineProperty(this, "uploadPromise", {
|
|
64
|
+
value: Promise.resolve(this.uploadResult),
|
|
65
|
+
writable: true,
|
|
66
|
+
enumerable: false,
|
|
67
|
+
configurable: true
|
|
68
|
+
});
|
|
62
69
|
this.uploadPromise = this._initializeAndStartUpload(file, options);
|
|
63
70
|
}
|
|
64
71
|
get isStoredFile() {
|
|
@@ -211,7 +211,8 @@ export class Model {
|
|
|
211
211
|
// Let DateParsingHelpers.serializeDate throw if it fails
|
|
212
212
|
return DateParsingHelpers.serializeDate(value, field, ModelClass.schema);
|
|
213
213
|
}
|
|
214
|
-
|
|
214
|
+
// FileObjects need special
|
|
215
|
+
const fileFormats = ["file-path", "image-path"];
|
|
215
216
|
if (ModelClass.schema &&
|
|
216
217
|
fileFormats.includes(ModelClass.schema.properties[field]?.format)) {
|
|
217
218
|
value = this.getField(field);
|
package/package.json
CHANGED