@tap-payments/os-micro-frontend-shared 0.1.110-test.2 → 0.1.111

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.
@@ -28,68 +28,6 @@ export interface Brand {
28
28
  name: TextAndLang[];
29
29
  logo: string;
30
30
  entities: (EntityDetails & Entity)[];
31
- activities: Array<{
32
- id: string;
33
- code: string;
34
- name: Record<string, string>;
35
- isic_code: string;
36
- mcc_value: {
37
- id: string;
38
- mcc: string;
39
- name: Record<string, string>;
40
- description: string;
41
- created: number;
42
- };
43
- }>;
44
- operations: {
45
- sales: {
46
- id: string;
47
- name: TextAndLang[];
48
- range: {
49
- from: number;
50
- to: number;
51
- };
52
- sub: Array<{
53
- id: string;
54
- name: TextAndLang[];
55
- range: {
56
- from: number;
57
- to: number;
58
- };
59
- }>;
60
- };
61
- customer_base: {
62
- id: string;
63
- name: TextAndLang[];
64
- locations: Array<{
65
- id: string;
66
- code: string;
67
- name: TextAndLang[];
68
- }>;
69
- };
70
- };
71
- segment: {
72
- team: {
73
- id: string;
74
- name: TextAndLang[];
75
- };
76
- location_type: {
77
- id: string;
78
- name: TextAndLang[];
79
- };
80
- profit_type: {
81
- id: string;
82
- name: TextAndLang[];
83
- tech_type: {
84
- id: string;
85
- name: TextAndLang[];
86
- };
87
- };
88
- };
89
- business_id: string;
90
- channel_services: Channel[];
91
- physical_store_available: boolean;
92
- data_state: string;
93
31
  }
94
32
  export interface BrandDetails {
95
33
  id: string;
@@ -1,6 +1,7 @@
1
1
  export declare function removeUndefinedValues(obj: Record<string, unknown>): {
2
2
  [k: string]: unknown;
3
3
  };
4
+ export declare const isEmptyValue: (value: unknown) => boolean;
4
5
  export declare function removeUndefinedArrayValues(obj: Record<string, unknown>): {
5
6
  [k: string]: unknown;
6
7
  };
@@ -1,14 +1,15 @@
1
1
  export function removeUndefinedValues(obj) {
2
2
  return Object.fromEntries(Object.entries(obj).filter(([, value]) => value !== undefined));
3
3
  }
4
+ export const isEmptyValue = (value) => value === undefined || value === null || value === '';
4
5
  export function removeUndefinedArrayValues(obj) {
5
6
  return Object.fromEntries(Object.entries(obj).filter(([, value]) => {
6
7
  if (Array.isArray(value)) {
7
- return value.length > 0 && (value === null || value === void 0 ? void 0 : value.some((v) => v !== undefined && v !== null && v !== ''));
8
+ return value.length > 0 && (value === null || value === void 0 ? void 0 : value.some((v) => !isEmptyValue(v)));
8
9
  }
9
10
  if (typeof value === 'object') {
10
- return Object.values(value || {}).some((v) => v !== undefined && v !== null && v !== '');
11
+ return Object.values(value || {}).some((v) => !isEmptyValue(v));
11
12
  }
12
- return !!value;
13
+ return !isEmptyValue(value);
13
14
  }));
14
15
  }
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@tap-payments/os-micro-frontend-shared",
3
3
  "description": "Shared components and utilities for Tap Payments micro frontends",
4
- "version": "0.1.110-test.2",
5
- "testVersion": 2,
4
+ "version": "0.1.111",
5
+ "testVersion": 1,
6
6
  "type": "module",
7
7
  "main": "build/index.js",
8
8
  "module": "build/index.js",
@@ -136,4 +136,4 @@
136
136
  "publishConfig": {
137
137
  "registry": "https://registry.npmjs.org/"
138
138
  }
139
- }
139
+ }