@bosonprotocol/metadata
Advanced tools
Comparing version 1.6.0-alpha.4 to 1.6.0-alpha.5
@@ -53,3 +53,9 @@ "use strict"; | ||
return variants.map((variant) => { | ||
return Object.assign(Object.assign({}, productMetadata), { uuid: buildUuid(), variations: variant }); | ||
const variantAttributes = variant.map((variation) => { | ||
return { | ||
trait_type: variation.type, | ||
value: variation.option | ||
}; | ||
}); | ||
return Object.assign(Object.assign({}, productMetadata), { uuid: buildUuid(), variations: variant, attributes: [...productMetadata.attributes, ...variantAttributes] }); | ||
}); | ||
@@ -56,0 +62,0 @@ } |
@@ -46,6 +46,13 @@ import { buildYup } from "schema-to-yup"; | ||
return variants.map((variant) => { | ||
const variantAttributes = variant.map((variation) => { | ||
return { | ||
trait_type: variation.type, | ||
value: variation.option | ||
}; | ||
}); | ||
return { | ||
...productMetadata, | ||
uuid: buildUuid(), | ||
variations: variant | ||
variations: variant, | ||
attributes: [...productMetadata.attributes, ...variantAttributes] | ||
}; | ||
@@ -52,0 +59,0 @@ }); |
{ | ||
"name": "@bosonprotocol/metadata", | ||
"version": "1.6.0-alpha.4", | ||
"version": "1.6.0-alpha.5", | ||
"description": "Offer metadata schemas, types and tools of the Boson Protocol.", | ||
@@ -42,3 +42,3 @@ "main": "./dist/cjs/index.js", | ||
}, | ||
"gitHead": "ed4febcd7df2d45f2e79bb98d113ec5d1455bde5" | ||
"gitHead": "10ce27a0bf02681458f1e9089f9761b905cbd3d2" | ||
} |
@@ -181,6 +181,13 @@ import { buildYup } from "schema-to-yup"; | ||
return variants.map((variant) => { | ||
const variantAttributes = variant.map((variation) => { | ||
return { | ||
trait_type: variation.type, | ||
value: variation.option | ||
}; | ||
}); | ||
return { | ||
...productMetadata, | ||
uuid: buildUuid(), | ||
variations: variant | ||
variations: variant, | ||
attributes: [...productMetadata.attributes, ...variantAttributes] | ||
}; | ||
@@ -187,0 +194,0 @@ }); |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
82155
1492