@rebilly/instruments 9.66.1 → 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 +6 -1
- package/dist/index.js +10 -0
- package/dist/index.min.js +9 -9
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -1 +1,6 @@
|
|
|
1
|
-
## [9.66.
|
|
1
|
+
## [9.66.2](https://github.com/Rebilly/rebilly/compare/instruments/core-v9.66.1...instruments/core-v9.66.2) (2024-07-10)
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
### Bug Fixes
|
|
5
|
+
|
|
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,
|