@labdigital/commercetools-mock 2.45.0 → 2.45.1

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.
package/dist/index.js CHANGED
@@ -4970,9 +4970,17 @@ var variantFromDraft = (context, storage, variantId, variant) => ({
4970
4970
  key: variant?.key,
4971
4971
  attributes: variant?.attributes ?? [],
4972
4972
  prices: variant?.prices?.map((p) => priceFromDraft(context, storage, p)),
4973
- assets: [],
4974
- images: []
4973
+ assets: variant.assets?.map((a) => assetFromDraft(context, storage, a)) ?? [],
4974
+ images: variant.images ?? []
4975
4975
  });
4976
+ var assetFromDraft = (context, storage, draft) => {
4977
+ const asset = {
4978
+ ...draft,
4979
+ id: uuidv410(),
4980
+ custom: createCustomFields(draft.custom, context.projectKey, storage)
4981
+ };
4982
+ return asset;
4983
+ };
4976
4984
  var priceFromDraft = (context, storage, draft) => ({
4977
4985
  id: uuidv410(),
4978
4986
  key: draft.key,