@tap-payments/os-micro-frontend-shared 0.1.331 → 0.1.332
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.
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import capitalize from 'lodash/capitalize';
|
|
2
|
+
import startCase from 'lodash/startCase';
|
|
2
3
|
import { PAYMENT_TYPES_ICONS } from '../constants/index.js';
|
|
3
4
|
import { getNameText } from './language';
|
|
4
5
|
export function transformPaymentMethodsData(data) {
|
|
@@ -8,7 +9,7 @@ export function transformPaymentMethodsData(data) {
|
|
|
8
9
|
options: data === null || data === void 0 ? void 0 : data.map((category) => {
|
|
9
10
|
var _a, _b;
|
|
10
11
|
return {
|
|
11
|
-
name: capitalize(getNameText(category === null || category === void 0 ? void 0 : category.name)),
|
|
12
|
+
name: capitalize(startCase(getNameText(category === null || category === void 0 ? void 0 : category.name))),
|
|
12
13
|
type: category === null || category === void 0 ? void 0 : category.code,
|
|
13
14
|
icon: (_a = PAYMENT_TYPES_ICONS[category.code]) !== null && _a !== void 0 ? _a : PAYMENT_TYPES_ICONS.CARD,
|
|
14
15
|
options: (_b = category.payment_methods) === null || _b === void 0 ? void 0 : _b.map((method) => ({
|
|
@@ -27,7 +28,7 @@ export function transformPaymentSchemesData(data = []) {
|
|
|
27
28
|
.filter((scheme) => scheme.code)
|
|
28
29
|
.map((scheme) => {
|
|
29
30
|
return {
|
|
30
|
-
name: getNameText(scheme === null || scheme === void 0 ? void 0 : scheme.name),
|
|
31
|
+
name: capitalize(startCase(getNameText(scheme === null || scheme === void 0 ? void 0 : scheme.name))),
|
|
31
32
|
type: scheme === null || scheme === void 0 ? void 0 : scheme.code,
|
|
32
33
|
};
|
|
33
34
|
}),
|
package/package.json
CHANGED