@xoxno/types 1.0.488 → 1.0.489
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.
|
@@ -310,9 +310,15 @@ __decorate([
|
|
|
310
310
|
__metadata("design:type", Number)
|
|
311
311
|
], NftDocBase.prototype, "_ts", void 0);
|
|
312
312
|
class NftDoc extends NftDocBase {
|
|
313
|
-
constructor() {
|
|
314
|
-
super(
|
|
313
|
+
constructor(props) {
|
|
314
|
+
super(props);
|
|
315
315
|
this.metadata = { attributes: [] };
|
|
316
|
+
// Subclass field initializers run AFTER the base constructor's
|
|
317
|
+
// Object.assign, so the `= { attributes: [] }` default above would
|
|
318
|
+
// silently clobber any metadata passed in props. Re-apply it.
|
|
319
|
+
if (props?.metadata !== undefined) {
|
|
320
|
+
this.metadata = props.metadata;
|
|
321
|
+
}
|
|
316
322
|
}
|
|
317
323
|
}
|
|
318
324
|
exports.NftDoc = NftDoc;
|