@ancon/wildcat-utils 1.55.0-check-optimizations.2 → 1.55.0
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/check/getOrganizedCheckItemModifications.d.ts +2 -2
- package/check/getOrganizedCheckItemModifications.js +1 -1
- package/check/getOrganizedCheckItemModifications.mjs +68 -74
- package/check/getUniqueCheckItemModificationId.d.ts +2 -2
- package/check/getUniqueCheckItemModificationId.js +1 -1
- package/check/getUniqueCheckItemModificationId.mjs +5 -5
- package/checkout/getCheckoutAdyenAmount.d.ts +9 -0
- package/checkout/getCheckoutAdyenAmount.js +1 -0
- package/checkout/getCheckoutAdyenAmount.mjs +13 -0
- package/checkout/getCheckoutGrandTotalAmount.d.ts +6 -2
- package/checkout/getCheckoutGrandTotalAmount.js +1 -1
- package/checkout/getCheckoutGrandTotalAmount.mjs +8 -6
- package/checkout/getCheckoutMinimumOrderDifferenceAmount.d.ts +7 -0
- package/checkout/getCheckoutMinimumOrderDifferenceAmount.js +1 -0
- package/checkout/getCheckoutMinimumOrderDifferenceAmount.mjs +12 -0
- package/checkout/index.d.ts +3 -1
- package/checkout/index.js +1 -1
- package/checkout/index.mjs +59 -55
- package/checkout/types.d.ts +5 -0
- package/index.js +1 -1
- package/index.mjs +235 -231
- package/multilingual/createLocalizedCheckDetails.d.ts +2 -2
- package/multilingual/createLocalizedCheckDetails.js +1 -1
- package/multilingual/createLocalizedCheckDetails.mjs +27 -31
- package/package.json +11 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";const
|
|
1
|
+
"use strict";const l=require("@ancon/wildcat-types");function u(e){switch(e){case"sv":return l.IETFLanguageTag.Swedish;case"nb":return l.IETFLanguageTag.Norwegian;case"en":return l.IETFLanguageTag.English;default:return null}}function s(e,c){var i,o;const t=e,a=(i=e.localizedProductNames)==null?void 0:i[c],n=(o=e.localizedVariantNames)==null?void 0:o[c];return a&&(t.productName=a),n&&(t.variantName=n),t}function m(e,c){var i,o;const t=e,a=(i=e.localizedNames)==null?void 0:i[c],n=(o=e.localizedReplacementNames)==null?void 0:o[c];return a&&(t.name=a),n&&(t.replacementName=n),t}function z(e,c){const t=e;return t.product=s(e.product,c),t}function d(e,c){const t=e,{product:a,modifications:n,addOnProducts:i,subCheckItems:o}=e;return t.product=s(a,c),n.length&&(t.modifications=n.map(r=>m(r,c))),i!=null&&i.length&&(t.addOnProducts=i.map(r=>z(r,c))),o.length&&(t.subCheckItems=o.map(r=>d(r,c))),t}function f(e,c){const t=u(c);if(t){const a=e;return a.items=e.items.map(n=>d(n,t)),a}return e}module.exports=f;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { IETFLanguageTag as r } from "@ancon/wildcat-types";
|
|
2
|
-
function
|
|
2
|
+
function u(e) {
|
|
3
3
|
switch (e) {
|
|
4
4
|
case "sv":
|
|
5
5
|
return r.Swedish;
|
|
@@ -11,47 +11,43 @@ function m(e) {
|
|
|
11
11
|
return null;
|
|
12
12
|
}
|
|
13
13
|
}
|
|
14
|
-
function
|
|
15
|
-
var
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
return n && (c.productName = n), o && (c.variantName = o), c;
|
|
19
|
-
}
|
|
20
|
-
return e;
|
|
14
|
+
function d(e, c) {
|
|
15
|
+
var i, n;
|
|
16
|
+
const t = e, a = (i = e.localizedProductNames) == null ? void 0 : i[c], o = (n = e.localizedVariantNames) == null ? void 0 : n[c];
|
|
17
|
+
return a && (t.productName = a), o && (t.variantName = o), t;
|
|
21
18
|
}
|
|
22
|
-
function
|
|
23
|
-
var
|
|
24
|
-
const t = e,
|
|
25
|
-
return
|
|
19
|
+
function m(e, c) {
|
|
20
|
+
var i, n;
|
|
21
|
+
const t = e, a = (i = e.localizedNames) == null ? void 0 : i[c], o = (n = e.localizedReplacementNames) == null ? void 0 : n[c];
|
|
22
|
+
return a && (t.name = a), o && (t.replacementName = o), t;
|
|
26
23
|
}
|
|
27
|
-
function f(e,
|
|
24
|
+
function f(e, c) {
|
|
28
25
|
const t = e;
|
|
29
|
-
return t.product =
|
|
26
|
+
return t.product = d(
|
|
30
27
|
e.product,
|
|
31
|
-
|
|
28
|
+
c
|
|
32
29
|
), t;
|
|
33
30
|
}
|
|
34
|
-
function
|
|
35
|
-
const t = e, { product:
|
|
36
|
-
return t.product =
|
|
37
|
-
(l) =>
|
|
38
|
-
)),
|
|
39
|
-
(l) => f(l,
|
|
40
|
-
)),
|
|
41
|
-
(l) =>
|
|
31
|
+
function s(e, c) {
|
|
32
|
+
const t = e, { product: a, modifications: o, addOnProducts: i, subCheckItems: n } = e;
|
|
33
|
+
return t.product = d(a, c), o.length && (t.modifications = o.map(
|
|
34
|
+
(l) => m(l, c)
|
|
35
|
+
)), i != null && i.length && (t.addOnProducts = i.map(
|
|
36
|
+
(l) => f(l, c)
|
|
37
|
+
)), n.length && (t.subCheckItems = n.map(
|
|
38
|
+
(l) => s(l, c)
|
|
42
39
|
)), t;
|
|
43
40
|
}
|
|
44
|
-
function
|
|
45
|
-
|
|
46
|
-
const t = m(a);
|
|
41
|
+
function p(e, c) {
|
|
42
|
+
const t = u(c);
|
|
47
43
|
if (t) {
|
|
48
|
-
const
|
|
49
|
-
return
|
|
50
|
-
(
|
|
51
|
-
),
|
|
44
|
+
const a = e;
|
|
45
|
+
return a.items = e.items.map(
|
|
46
|
+
(o) => s(o, t)
|
|
47
|
+
), a;
|
|
52
48
|
}
|
|
53
49
|
return e;
|
|
54
50
|
}
|
|
55
51
|
export {
|
|
56
|
-
|
|
52
|
+
p as default
|
|
57
53
|
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ancon/wildcat-utils",
|
|
3
|
-
"version": "1.55.0
|
|
3
|
+
"version": "1.55.0",
|
|
4
4
|
"main": "index.js",
|
|
5
5
|
"module": "index.mjs",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -180,6 +180,11 @@
|
|
|
180
180
|
"require": "./checkout/checkoutHasWallet.js",
|
|
181
181
|
"types": "./checkout/checkoutHasWallet.d.ts"
|
|
182
182
|
},
|
|
183
|
+
"./checkout/getCheckoutAdyenAmount": {
|
|
184
|
+
"import": "./checkout/getCheckoutAdyenAmount.mjs",
|
|
185
|
+
"require": "./checkout/getCheckoutAdyenAmount.js",
|
|
186
|
+
"types": "./checkout/getCheckoutAdyenAmount.d.ts"
|
|
187
|
+
},
|
|
183
188
|
"./checkout/getCheckoutGiftCardMetaData": {
|
|
184
189
|
"import": "./checkout/getCheckoutGiftCardMetaData.mjs",
|
|
185
190
|
"require": "./checkout/getCheckoutGiftCardMetaData.js",
|
|
@@ -210,6 +215,11 @@
|
|
|
210
215
|
"require": "./checkout/getCheckoutItemsMappedByTicketItemStatus.js",
|
|
211
216
|
"types": "./checkout/getCheckoutItemsMappedByTicketItemStatus.d.ts"
|
|
212
217
|
},
|
|
218
|
+
"./checkout/getCheckoutMinimumOrderDifferenceAmount": {
|
|
219
|
+
"import": "./checkout/getCheckoutMinimumOrderDifferenceAmount.mjs",
|
|
220
|
+
"require": "./checkout/getCheckoutMinimumOrderDifferenceAmount.js",
|
|
221
|
+
"types": "./checkout/getCheckoutMinimumOrderDifferenceAmount.d.ts"
|
|
222
|
+
},
|
|
213
223
|
"./checkout/getCheckoutOrderStatusTexts": {
|
|
214
224
|
"import": "./checkout/getCheckoutOrderStatusTexts.mjs",
|
|
215
225
|
"require": "./checkout/getCheckoutOrderStatusTexts.js",
|