@pretto/places 0.8.0 → 0.9.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/dist/addressSearch.d.ts.map +1 -1
- package/dist/index.js +15 -10
- package/dist/module.js +15 -10
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"addressSearch.d.ts","sourceRoot":"","sources":["../src/addressSearch.ts"],"names":[],"mappings":"AAAA,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;QACf,MAAM,EAAE,MAAM,CAAA;QACd,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;CACF;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAA;QACb,QAAQ,EAAE,MAAM,CAAA;QAChB,IAAI,EAAE,MAAM,CAAA;QACZ,WAAW,EAAE,MAAM,CAAA;QACnB,MAAM,EAAE,MAAM,CAAA;KACf,CAAA;CACF;AAED,UAAU,OAAO;IACf,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;CACd;AAED,aAAK,aAAa,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,mBAAmB,EAAE,GAAG,MAAM,CAAC,CAAA;AAEnG,eAAO,MAAM,GAAG,EAAE,
|
1
|
+
{"version":3,"file":"addressSearch.d.ts","sourceRoot":"","sources":["../src/addressSearch.ts"],"names":[],"mappings":"AAAA,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAA;IACb,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;QACf,MAAM,EAAE,MAAM,CAAA;QACd,OAAO,EAAE,MAAM,CAAA;KAChB,CAAA;CACF;AAED,MAAM,WAAW,gBAAgB;IAC/B,UAAU,EAAE;QACV,KAAK,EAAE,MAAM,CAAA;QACb,QAAQ,EAAE,MAAM,CAAA;QAChB,IAAI,EAAE,MAAM,CAAA;QACZ,WAAW,EAAE,MAAM,CAAA;QACnB,MAAM,EAAE,MAAM,CAAA;KACf,CAAA;CACF;AAED,UAAU,OAAO;IACf,OAAO,EAAE,MAAM,CAAA;IACf,KAAK,EAAE,MAAM,CAAA;CACd;AAED,aAAK,aAAa,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,OAAO,KAAK,OAAO,CAAC,mBAAmB,EAAE,GAAG,MAAM,CAAC,CAAA;AAEnG,eAAO,MAAM,GAAG,EAAE,aAiCjB,CAAA"}
|
package/dist/index.js
CHANGED
@@ -149,17 +149,22 @@ const get$1 = (search, options) => __awaiter(void 0, void 0, void 0, function* (
|
|
149
149
|
if (!response.ok)
|
150
150
|
return Promise.reject(response);
|
151
151
|
const result = yield response.json();
|
152
|
-
return result.features.
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
|
158
|
-
|
159
|
-
|
152
|
+
return result.features.reduce((acc, { properties }) => {
|
153
|
+
if (!properties.street)
|
154
|
+
return acc;
|
155
|
+
return [
|
156
|
+
...acc,
|
157
|
+
{
|
158
|
+
label: `${properties.label} (${properties.postcode})`,
|
159
|
+
value: {
|
160
|
+
city: properties.city,
|
161
|
+
country,
|
162
|
+
street: `${properties.housenumber || ''} ${properties.street}`,
|
163
|
+
zipcode: properties.postcode,
|
164
|
+
},
|
160
165
|
},
|
161
|
-
|
162
|
-
});
|
166
|
+
];
|
167
|
+
}, []);
|
163
168
|
}
|
164
169
|
catch (error) {
|
165
170
|
if (typeof error === 'string')
|
package/dist/module.js
CHANGED
@@ -139,17 +139,22 @@ const get$1 = (search, options) => __awaiter(void 0, void 0, void 0, function* (
|
|
139
139
|
if (!response.ok)
|
140
140
|
return Promise.reject(response);
|
141
141
|
const result = yield response.json();
|
142
|
-
return result.features.
|
143
|
-
|
144
|
-
|
145
|
-
|
146
|
-
|
147
|
-
|
148
|
-
|
149
|
-
|
142
|
+
return result.features.reduce((acc, { properties }) => {
|
143
|
+
if (!properties.street)
|
144
|
+
return acc;
|
145
|
+
return [
|
146
|
+
...acc,
|
147
|
+
{
|
148
|
+
label: `${properties.label} (${properties.postcode})`,
|
149
|
+
value: {
|
150
|
+
city: properties.city,
|
151
|
+
country,
|
152
|
+
street: `${properties.housenumber || ''} ${properties.street}`,
|
153
|
+
zipcode: properties.postcode,
|
154
|
+
},
|
150
155
|
},
|
151
|
-
|
152
|
-
});
|
156
|
+
];
|
157
|
+
}, []);
|
153
158
|
}
|
154
159
|
catch (error) {
|
155
160
|
if (typeof error === 'string')
|