@rebilly/instruments 9.66.0 → 9.66.2

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
- ## [9.66.0](https://github.com/Rebilly/rebilly/compare/instruments/core-v9.65.1...instruments/core-v9.66.0) (2024-07-09)
1
+ ## [9.66.2](https://github.com/Rebilly/rebilly/compare/instruments/core-v9.66.1...instruments/core-v9.66.2) (2024-07-10)
2
2
 
3
3
 
4
- ### Features
4
+ ### Bug Fixes
5
5
 
6
- * **api-metadata, rebilly-js-sdk:** Update resources based on latest api definitions ([#6384](https://github.com/Rebilly/rebilly/issues/6384)) ([58fd992](https://github.com/Rebilly/rebilly/commit/58fd9924c23bbaf927bdb0ad3a52184ecad3690b))
6
+ * **instruments:** Purchase Preview was not filtering out duplicated line items ([#6417](https://github.com/Rebilly/rebilly/issues/6417)) ([b4414f1](https://github.com/Rebilly/rebilly/commit/b4414f1ee68e2bb34d659b09061a8e83f59951a6))
package/dist/index.js CHANGED
@@ -10836,6 +10836,16 @@ async function fetchSummary({
10836
10836
  state.data.previewPurchase.addonLineItems
10837
10837
  );
10838
10838
  }
10839
+ if (payload.data.items && payload.data.items.length > 1) {
10840
+ const itemsStringified = payload.data.items.map(
10841
+ (item) => JSON.stringify(item)
10842
+ );
10843
+ const itemsSet = new Set(itemsStringified);
10844
+ const uniqueItems2 = Array.from(itemsSet).map(
10845
+ (item) => JSON.parse(item)
10846
+ );
10847
+ payload.data.items = uniqueItems2;
10848
+ }
10839
10849
  if ((_v = state.data) == null ? void 0 : _v.amountAndCurrency) {
10840
10850
  payload.data = {
10841
10851
  ...payload.data,