@medipass/utils 11.80.7-chore-update-react-places-autocomplete.0 → 11.80.7
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/constants.d.ts +2 -2
- package/constants.js +2 -2
- package/google-addresses.d.ts +8 -13
- package/google-addresses.js +25 -13
- package/package.json +3 -4
package/constants.d.ts
CHANGED
|
@@ -23,11 +23,11 @@ export declare const STANDALONE_ERRORS: {
|
|
|
23
23
|
};
|
|
24
24
|
readonly providerNumberNotFound: {
|
|
25
25
|
readonly code: "providerNumberNotFound";
|
|
26
|
-
readonly message: "
|
|
26
|
+
readonly message: "Provider number not found.";
|
|
27
27
|
};
|
|
28
28
|
readonly providerNumberDoesNotMatchFunder: {
|
|
29
29
|
readonly code: "providerNumberDoesNotMatchFunder";
|
|
30
|
-
readonly message: "Provider number does not match
|
|
30
|
+
readonly message: "Provider number does not match funder.";
|
|
31
31
|
};
|
|
32
32
|
};
|
|
33
33
|
export declare const DOCUMENT_STATUSES: {
|
package/constants.js
CHANGED
|
@@ -30,11 +30,11 @@ var STANDALONE_ERRORS = {
|
|
|
30
30
|
},
|
|
31
31
|
providerNumberNotFound: {
|
|
32
32
|
code: 'providerNumberNotFound',
|
|
33
|
-
message: '
|
|
33
|
+
message: 'Provider number not found.'
|
|
34
34
|
},
|
|
35
35
|
providerNumberDoesNotMatchFunder: {
|
|
36
36
|
code: 'providerNumberDoesNotMatchFunder',
|
|
37
|
-
message: 'Provider number does not match
|
|
37
|
+
message: 'Provider number does not match funder.'
|
|
38
38
|
}
|
|
39
39
|
};
|
|
40
40
|
/* ====== END: ERRORS ======= */
|
package/google-addresses.d.ts
CHANGED
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
export declare function geocodeAddress(address: any): Promise<{
|
|
2
|
+
results: any[];
|
|
3
|
+
latLng: {
|
|
4
|
+
lng: number;
|
|
5
|
+
lat: number;
|
|
6
|
+
};
|
|
5
7
|
}>;
|
|
6
|
-
export declare const mapAddressComponents: (addressComponents:
|
|
7
|
-
export declare const parseAddress: (addressComponents:
|
|
8
|
-
address?: string | undefined;
|
|
9
|
-
countryCode?: string | undefined;
|
|
10
|
-
country?: string | undefined;
|
|
11
|
-
state?: string | undefined;
|
|
12
|
-
city?: string | undefined;
|
|
13
|
-
postcode?: string | undefined;
|
|
14
|
-
};
|
|
8
|
+
export declare const mapAddressComponents: (addressComponents: any) => {};
|
|
9
|
+
export declare const parseAddress: (addressComponents: any) => {};
|
package/google-addresses.js
CHANGED
|
@@ -18,7 +18,8 @@ var ADDRESS_COMPONENT_MAPPINGS = {
|
|
|
18
18
|
state: 'administrative_area_level_1',
|
|
19
19
|
city: 'locality',
|
|
20
20
|
postcode: 'postal_code'
|
|
21
|
-
};
|
|
21
|
+
}; // @ts-expect-error TS(7006): Parameter 'address' implicitly has an 'any' type.
|
|
22
|
+
|
|
22
23
|
function geocodeAddress(address) {
|
|
23
24
|
return new Promise( /*#__PURE__*/function () {
|
|
24
25
|
var _ref = _asyncToGenerator( /*#__PURE__*/_regeneratorRuntime.mark(function _callee2(res, rej) {
|
|
@@ -82,15 +83,15 @@ function geocodeAddress(address) {
|
|
|
82
83
|
return _ref.apply(this, arguments);
|
|
83
84
|
};
|
|
84
85
|
}());
|
|
85
|
-
}
|
|
86
|
+
} // @ts-expect-error TS(7006): Parameter 'addressComponents' implicitly has an 'a... Remove this comment to see the full error message
|
|
87
|
+
|
|
86
88
|
var mapAddressComponents = function mapAddressComponents(addressComponents) {
|
|
87
89
|
var components = {};
|
|
88
90
|
|
|
89
91
|
_forEach(addressComponents, function (component) {
|
|
90
92
|
_forOwn(ADDRESS_COMPONENT_MAPPINGS, function (mapping, key) {
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
if ((component == null ? void 0 : (_component$types = component.types) == null ? void 0 : _component$types[0]) === mapping) {
|
|
93
|
+
if (component.types[0] === mapping) {
|
|
94
|
+
// @ts-expect-error TS(7053): Element implicitly has an 'any' type because expre... Remove this comment to see the full error message
|
|
94
95
|
components[key] = {
|
|
95
96
|
longName: component.long_name,
|
|
96
97
|
shortName: component.short_name
|
|
@@ -100,24 +101,35 @@ var mapAddressComponents = function mapAddressComponents(addressComponents) {
|
|
|
100
101
|
});
|
|
101
102
|
|
|
102
103
|
return components;
|
|
103
|
-
};
|
|
104
|
+
}; // @ts-expect-error TS(7006): Parameter 'addressComponents' implicitly has an 'a... Remove this comment to see the full error message
|
|
105
|
+
|
|
104
106
|
var parseAddress = function parseAddress(addressComponents) {
|
|
105
107
|
var requestData = {};
|
|
106
108
|
|
|
107
109
|
if (addressComponents) {
|
|
108
|
-
var address = mapAddressComponents(addressComponents);
|
|
110
|
+
var address = mapAddressComponents(addressComponents); // @ts-expect-error TS(2339): Property 'route' does not exist on type '{}'.
|
|
109
111
|
|
|
110
112
|
if (address.route) {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
+
// @ts-expect-error TS(2339): Property 'address' does not exist on type '{}'.
|
|
114
|
+
requestData.address = // @ts-expect-error
|
|
115
|
+
"" + (address.subpremise ? address.subpremise.longName + "/" : '') + ( // @ts-expect-error
|
|
116
|
+
(address.streetNumber ? address.streetNumber.longName : '') + " ") + ( // @ts-expect-error
|
|
117
|
+
"" + address.route.longName);
|
|
118
|
+
} // @ts-expect-error TS(2339): Property 'country' does not exist on type '{}'.
|
|
119
|
+
|
|
113
120
|
|
|
114
121
|
if (address.country) {
|
|
115
|
-
|
|
122
|
+
// @ts-expect-error TS(2339): Property 'countryCode' does not exist on type '{}'... Remove this comment to see the full error message
|
|
123
|
+
requestData.countryCode = address.country.shortName; // @ts-expect-error TS(2339): Property 'country' does not exist on type '{}'.
|
|
124
|
+
|
|
116
125
|
requestData.country = address.country.longName;
|
|
117
|
-
}
|
|
126
|
+
} // @ts-expect-error TS(2339): Property 'state' does not exist on type '{}'.
|
|
127
|
+
|
|
128
|
+
|
|
129
|
+
requestData.state = address.state ? address.state.longName : null; // @ts-expect-error TS(2339): Property 'city' does not exist on type '{}'.
|
|
130
|
+
|
|
131
|
+
requestData.city = address.city ? address.city.longName : null; // @ts-expect-error TS(2339): Property 'postcode' does not exist on type '{}'.
|
|
118
132
|
|
|
119
|
-
requestData.state = address.state ? address.state.longName : null;
|
|
120
|
-
requestData.city = address.city ? address.city.longName : null;
|
|
121
133
|
requestData.postcode = address.postcode ? address.postcode.longName : null;
|
|
122
134
|
}
|
|
123
135
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@medipass/utils",
|
|
3
|
-
"version": "11.80.7
|
|
3
|
+
"version": "11.80.7",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"types": "index.d.ts",
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
"masked": "1.1.0",
|
|
39
39
|
"moment": "2.22.2",
|
|
40
40
|
"react-i18next": "11.7.0",
|
|
41
|
-
"react-places-autocomplete": "
|
|
41
|
+
"react-places-autocomplete": "5.4.3",
|
|
42
42
|
"react-redux": "8.0.5",
|
|
43
43
|
"redux": "4.2.1",
|
|
44
44
|
"redux-sentry-middleware": "0.1.3",
|
|
@@ -47,11 +47,10 @@
|
|
|
47
47
|
"devDependencies": {
|
|
48
48
|
"@babel/plugin-transform-runtime": "7.8.3",
|
|
49
49
|
"@types/jest": "29.1.2",
|
|
50
|
-
"@types/react-places-autocomplete": "7.2.9",
|
|
51
50
|
"redux-mock-store": "^1.3.0",
|
|
52
51
|
"redux-thunk": "^2.2.0",
|
|
53
52
|
"rimraf": "^2.6.2",
|
|
54
53
|
"typescript": "4.8.4"
|
|
55
54
|
},
|
|
56
|
-
"gitHead": "
|
|
55
|
+
"gitHead": "7db06272444924d1417277655ade56fb649c3887"
|
|
57
56
|
}
|