@pretto/places 0.46.0 → 0.46.1
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/README.md +1 -2
- package/dist/config/constants.d.ts +3 -3
- package/dist/config/constants.d.ts.map +1 -1
- package/dist/index.js +97 -65
- package/dist/module.js +97 -65
- package/dist/searchByAddress.d.ts.map +1 -1
- package/dist/searchByDepartment.d.ts.map +1 -1
- package/dist/searchByMunicipality.d.ts.map +1 -1
- package/dist/searchByZipcode.d.ts.map +1 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -209,5 +209,4 @@ This library is based on the API of data.gouv.
|
|
|
209
209
|
These data are quite precise and are regularly updated:
|
|
210
210
|

|
|
211
211
|
|
|
212
|
-
- https://
|
|
213
|
-
- https://api.gouv.fr/
|
|
212
|
+
- [https://geo.api.gouv.fr/](https://geo.api.gouv.fr/)
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export declare const MUNICIPALITY_API_URL = "https://geo.
|
|
2
|
-
export declare const DEPARTMENT_API_URL = "https://geo.
|
|
3
|
-
export declare const ADDRESS_API_URL = "https://
|
|
1
|
+
export declare const MUNICIPALITY_API_URL = "https://api-geo.production.pretto.fr/communes";
|
|
2
|
+
export declare const DEPARTMENT_API_URL = "https://api-geo.production.pretto.fr/departements";
|
|
3
|
+
export declare const ADDRESS_API_URL = "https://addok.production.pretto.fr/search";
|
|
4
4
|
export declare const FIELDS = "&fields=codeDepartement,nom,codesPostaux,contour,mairie,centre";
|
|
5
5
|
export declare const BOOST = "&boost=population";
|
|
6
6
|
export declare const TYPES = "&type=arrondissement-municipal,commune-actuelle";
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/config/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,
|
|
1
|
+
{"version":3,"file":"constants.d.ts","sourceRoot":"","sources":["../../src/config/constants.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,oBAAoB,kDAAkD,CAAA;AACnF,eAAO,MAAM,kBAAkB,sDAAsD,CAAA;AACrF,eAAO,MAAM,eAAe,8CAA8C,CAAA;AAE1E,eAAO,MAAM,MAAM,mEAAmE,CAAA;AACtF,eAAO,MAAM,KAAK,sBAAsB,CAAA;AACxC,eAAO,MAAM,KAAK,oDAAoD,CAAA"}
|
package/dist/index.js
CHANGED
|
@@ -47,9 +47,9 @@ const getSignal = () => {
|
|
|
47
47
|
return controller.current.signal;
|
|
48
48
|
};
|
|
49
49
|
|
|
50
|
-
const MUNICIPALITY_API_URL = 'https://geo.
|
|
51
|
-
const DEPARTMENT_API_URL = 'https://geo.
|
|
52
|
-
const ADDRESS_API_URL = 'https://
|
|
50
|
+
const MUNICIPALITY_API_URL = 'https://api-geo.production.pretto.fr/communes';
|
|
51
|
+
const DEPARTMENT_API_URL = 'https://api-geo.production.pretto.fr/departements';
|
|
52
|
+
const ADDRESS_API_URL = 'https://addok.production.pretto.fr/search';
|
|
53
53
|
const FIELDS = '&fields=codeDepartement,nom,codesPostaux,contour,mairie,centre';
|
|
54
54
|
const BOOST = '&boost=population';
|
|
55
55
|
const TYPES = '&type=arrondissement-municipal,commune-actuelle';
|
|
@@ -104,23 +104,31 @@ function customFetch(url, options) {
|
|
|
104
104
|
const searchByAddress = (searchValue, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
105
105
|
const url = `${ADDRESS_API_URL}/?q=${searchValue}&autocomplete=1&limit=${(options === null || options === void 0 ? void 0 : options.limit) || 10}`;
|
|
106
106
|
const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal();
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
107
|
+
try {
|
|
108
|
+
const addressResponse = yield customFetch(url, Object.assign(Object.assign({}, options), { signal }));
|
|
109
|
+
const addressResult = yield addressResponse.json();
|
|
110
|
+
const formatAddressResult = addressResult.features.reduce((acc, { properties }) => {
|
|
111
|
+
return [
|
|
112
|
+
...acc,
|
|
113
|
+
{
|
|
114
|
+
label: `${properties.name} ${properties.postcode}, ${properties.city}`,
|
|
115
|
+
value: {
|
|
116
|
+
city: properties.city,
|
|
117
|
+
country: 'fr',
|
|
118
|
+
street: `${properties.name}`,
|
|
119
|
+
zipcode: properties.postcode,
|
|
120
|
+
},
|
|
119
121
|
},
|
|
120
|
-
|
|
121
|
-
];
|
|
122
|
-
|
|
123
|
-
|
|
122
|
+
];
|
|
123
|
+
}, []);
|
|
124
|
+
return formatAddressResult;
|
|
125
|
+
}
|
|
126
|
+
catch (error) {
|
|
127
|
+
if (error instanceof DOMException && error.name === 'AbortError') {
|
|
128
|
+
return [];
|
|
129
|
+
}
|
|
130
|
+
throw error;
|
|
131
|
+
}
|
|
124
132
|
});
|
|
125
133
|
|
|
126
134
|
const formatToMunicipalitySearchResult = (results) => {
|
|
@@ -153,28 +161,36 @@ const searchByCoordinates = ({ latitude, longitude }, options) => __awaiter(void
|
|
|
153
161
|
});
|
|
154
162
|
|
|
155
163
|
const searchByDepartment = (searchValue, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
164
|
+
try {
|
|
165
|
+
if (isNaN(parseInt(searchValue))) {
|
|
166
|
+
const nameDepartmentUrl = `${DEPARTMENT_API_URL}?nom=${searchValue}&fields=region,codeRegion&limit=21`;
|
|
167
|
+
const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal();
|
|
168
|
+
const departmentResponse = yield customFetch(nameDepartmentUrl, Object.assign(Object.assign({}, options), { signal }));
|
|
169
|
+
const departmentResult = yield departmentResponse.json();
|
|
170
|
+
return departmentResult.map(result => ({
|
|
171
|
+
label: `${result.nom} (${result.code})`,
|
|
172
|
+
value: {
|
|
173
|
+
code: result.code,
|
|
174
|
+
codeRegion: result.codeRegion,
|
|
175
|
+
country: 'fr',
|
|
176
|
+
region: result.region,
|
|
177
|
+
},
|
|
178
|
+
}));
|
|
179
|
+
}
|
|
180
|
+
const codeDepartmentUrl = `${DEPARTMENT_API_URL}/${searchValue}?limit=1`;
|
|
181
|
+
const departmentResponse = yield customFetch(codeDepartmentUrl, options);
|
|
160
182
|
const departmentResult = yield departmentResponse.json();
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
codeRegion: result.codeRegion,
|
|
166
|
-
country: 'fr',
|
|
167
|
-
region: result.region,
|
|
168
|
-
},
|
|
169
|
-
}));
|
|
183
|
+
if ('nom' in departmentResult) {
|
|
184
|
+
return searchByDepartment(departmentResult.nom, options);
|
|
185
|
+
}
|
|
186
|
+
return [];
|
|
170
187
|
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
188
|
+
catch (error) {
|
|
189
|
+
if (error instanceof DOMException && error.name === 'AbortError') {
|
|
190
|
+
return [];
|
|
191
|
+
}
|
|
192
|
+
throw error;
|
|
176
193
|
}
|
|
177
|
-
return [];
|
|
178
194
|
});
|
|
179
195
|
|
|
180
196
|
function isStartsWith(arr, value) {
|
|
@@ -200,40 +216,56 @@ const searchByMunicipality = (searchValue, options) => __awaiter(void 0, void 0,
|
|
|
200
216
|
CURRENT_RESULT = [];
|
|
201
217
|
const url = `${MUNICIPALITY_API_URL}?nom=${searchValue}${FIELDS}${BOOST}&limit=${(options === null || options === void 0 ? void 0 : options.limit) || 10}`;
|
|
202
218
|
const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal();
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
219
|
+
try {
|
|
220
|
+
const cityResponse = yield customFetch(url, Object.assign(Object.assign({}, options), { signal }));
|
|
221
|
+
const cityResult = yield cityResponse.json();
|
|
222
|
+
// The first result is Paris, Lyon or Marseille, we want get all arrondissements
|
|
223
|
+
if (cityResult.length > 0 && ['75', '13', '69'].includes(cityResult[0].codeDepartement)) {
|
|
224
|
+
const url = `${MUNICIPALITY_API_URL}?nom=${searchValue}&codeDepartement=${cityResult[0].codeDepartement}${FIELDS}${BOOST}${TYPES}&limit=21`;
|
|
225
|
+
const arrondissementsResponse = yield customFetch(url);
|
|
226
|
+
const arrondissementsResult = yield arrondissementsResponse.json();
|
|
227
|
+
const filtredAndSortArrondissementsResult = arrondissementsResult
|
|
228
|
+
.reduce((acc, item) => {
|
|
229
|
+
if (['75056', '13055', '69123'].includes(item.code))
|
|
230
|
+
return acc;
|
|
231
|
+
return [
|
|
232
|
+
...acc,
|
|
233
|
+
Object.assign(Object.assign({}, item), { codesPostaux: [item.codesPostaux[0]] }),
|
|
234
|
+
];
|
|
235
|
+
}, [])
|
|
236
|
+
.sort((a, b) => parseInt(a.codesPostaux[0]) - parseInt(b.codesPostaux[0]));
|
|
237
|
+
CURRENT_RESULT = filtredAndSortArrondissementsResult;
|
|
238
|
+
if (isStartsWith(SPECIAL_CITIES, searchValue.toLowerCase())) {
|
|
239
|
+
const filtredCurrentResult = filterOnCurrentResult(searchValue);
|
|
240
|
+
return formatToMunicipalitySearchResult(filtredCurrentResult);
|
|
241
|
+
}
|
|
242
|
+
return formatToMunicipalitySearchResult(filterCityResults([...filtredAndSortArrondissementsResult, ...cityResult]));
|
|
224
243
|
}
|
|
225
|
-
return formatToMunicipalitySearchResult(filterCityResults(
|
|
244
|
+
return formatToMunicipalitySearchResult(filterCityResults(cityResult));
|
|
245
|
+
}
|
|
246
|
+
catch (error) {
|
|
247
|
+
if (error instanceof DOMException && error.name === 'AbortError') {
|
|
248
|
+
return [];
|
|
249
|
+
}
|
|
250
|
+
throw error;
|
|
226
251
|
}
|
|
227
|
-
return formatToMunicipalitySearchResult(filterCityResults(cityResult));
|
|
228
252
|
});
|
|
229
253
|
|
|
230
254
|
const searchByZipcode = (searchValue, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
231
255
|
const url = `${MUNICIPALITY_API_URL}?codePostal=${searchValue}${FIELDS}${BOOST}${TYPES}`;
|
|
232
256
|
const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal();
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
257
|
+
try {
|
|
258
|
+
const zipCodeResponse = yield customFetch(url, Object.assign(Object.assign({}, options), { signal }));
|
|
259
|
+
const zipCodeResult = yield zipCodeResponse.json();
|
|
260
|
+
const filtredZipCodeResult = zipCodeResult.filter(item => !['75056', '13055', '69123'].includes(item.code));
|
|
261
|
+
return formatToMunicipalitySearchResult(filtredZipCodeResult);
|
|
262
|
+
}
|
|
263
|
+
catch (error) {
|
|
264
|
+
if (error instanceof DOMException && error.name === 'AbortError') {
|
|
265
|
+
return [];
|
|
266
|
+
}
|
|
267
|
+
throw error;
|
|
268
|
+
}
|
|
237
269
|
});
|
|
238
270
|
|
|
239
271
|
const convertFirstLetterToUpperCase = (str) => {
|
package/dist/module.js
CHANGED
|
@@ -39,9 +39,9 @@ const getSignal = () => {
|
|
|
39
39
|
return controller.current.signal;
|
|
40
40
|
};
|
|
41
41
|
|
|
42
|
-
const MUNICIPALITY_API_URL = 'https://geo.
|
|
43
|
-
const DEPARTMENT_API_URL = 'https://geo.
|
|
44
|
-
const ADDRESS_API_URL = 'https://
|
|
42
|
+
const MUNICIPALITY_API_URL = 'https://api-geo.production.pretto.fr/communes';
|
|
43
|
+
const DEPARTMENT_API_URL = 'https://api-geo.production.pretto.fr/departements';
|
|
44
|
+
const ADDRESS_API_URL = 'https://addok.production.pretto.fr/search';
|
|
45
45
|
const FIELDS = '&fields=codeDepartement,nom,codesPostaux,contour,mairie,centre';
|
|
46
46
|
const BOOST = '&boost=population';
|
|
47
47
|
const TYPES = '&type=arrondissement-municipal,commune-actuelle';
|
|
@@ -96,23 +96,31 @@ function customFetch(url, options) {
|
|
|
96
96
|
const searchByAddress = (searchValue, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
97
97
|
const url = `${ADDRESS_API_URL}/?q=${searchValue}&autocomplete=1&limit=${(options === null || options === void 0 ? void 0 : options.limit) || 10}`;
|
|
98
98
|
const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal();
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
99
|
+
try {
|
|
100
|
+
const addressResponse = yield customFetch(url, Object.assign(Object.assign({}, options), { signal }));
|
|
101
|
+
const addressResult = yield addressResponse.json();
|
|
102
|
+
const formatAddressResult = addressResult.features.reduce((acc, { properties }) => {
|
|
103
|
+
return [
|
|
104
|
+
...acc,
|
|
105
|
+
{
|
|
106
|
+
label: `${properties.name} ${properties.postcode}, ${properties.city}`,
|
|
107
|
+
value: {
|
|
108
|
+
city: properties.city,
|
|
109
|
+
country: 'fr',
|
|
110
|
+
street: `${properties.name}`,
|
|
111
|
+
zipcode: properties.postcode,
|
|
112
|
+
},
|
|
111
113
|
},
|
|
112
|
-
|
|
113
|
-
];
|
|
114
|
-
|
|
115
|
-
|
|
114
|
+
];
|
|
115
|
+
}, []);
|
|
116
|
+
return formatAddressResult;
|
|
117
|
+
}
|
|
118
|
+
catch (error) {
|
|
119
|
+
if (error instanceof DOMException && error.name === 'AbortError') {
|
|
120
|
+
return [];
|
|
121
|
+
}
|
|
122
|
+
throw error;
|
|
123
|
+
}
|
|
116
124
|
});
|
|
117
125
|
|
|
118
126
|
const formatToMunicipalitySearchResult = (results) => {
|
|
@@ -145,28 +153,36 @@ const searchByCoordinates = ({ latitude, longitude }, options) => __awaiter(void
|
|
|
145
153
|
});
|
|
146
154
|
|
|
147
155
|
const searchByDepartment = (searchValue, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
156
|
+
try {
|
|
157
|
+
if (isNaN(parseInt(searchValue))) {
|
|
158
|
+
const nameDepartmentUrl = `${DEPARTMENT_API_URL}?nom=${searchValue}&fields=region,codeRegion&limit=21`;
|
|
159
|
+
const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal();
|
|
160
|
+
const departmentResponse = yield customFetch(nameDepartmentUrl, Object.assign(Object.assign({}, options), { signal }));
|
|
161
|
+
const departmentResult = yield departmentResponse.json();
|
|
162
|
+
return departmentResult.map(result => ({
|
|
163
|
+
label: `${result.nom} (${result.code})`,
|
|
164
|
+
value: {
|
|
165
|
+
code: result.code,
|
|
166
|
+
codeRegion: result.codeRegion,
|
|
167
|
+
country: 'fr',
|
|
168
|
+
region: result.region,
|
|
169
|
+
},
|
|
170
|
+
}));
|
|
171
|
+
}
|
|
172
|
+
const codeDepartmentUrl = `${DEPARTMENT_API_URL}/${searchValue}?limit=1`;
|
|
173
|
+
const departmentResponse = yield customFetch(codeDepartmentUrl, options);
|
|
152
174
|
const departmentResult = yield departmentResponse.json();
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
codeRegion: result.codeRegion,
|
|
158
|
-
country: 'fr',
|
|
159
|
-
region: result.region,
|
|
160
|
-
},
|
|
161
|
-
}));
|
|
175
|
+
if ('nom' in departmentResult) {
|
|
176
|
+
return searchByDepartment(departmentResult.nom, options);
|
|
177
|
+
}
|
|
178
|
+
return [];
|
|
162
179
|
}
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
180
|
+
catch (error) {
|
|
181
|
+
if (error instanceof DOMException && error.name === 'AbortError') {
|
|
182
|
+
return [];
|
|
183
|
+
}
|
|
184
|
+
throw error;
|
|
168
185
|
}
|
|
169
|
-
return [];
|
|
170
186
|
});
|
|
171
187
|
|
|
172
188
|
function isStartsWith(arr, value) {
|
|
@@ -192,40 +208,56 @@ const searchByMunicipality = (searchValue, options) => __awaiter(void 0, void 0,
|
|
|
192
208
|
CURRENT_RESULT = [];
|
|
193
209
|
const url = `${MUNICIPALITY_API_URL}?nom=${searchValue}${FIELDS}${BOOST}&limit=${(options === null || options === void 0 ? void 0 : options.limit) || 10}`;
|
|
194
210
|
const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal();
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
211
|
+
try {
|
|
212
|
+
const cityResponse = yield customFetch(url, Object.assign(Object.assign({}, options), { signal }));
|
|
213
|
+
const cityResult = yield cityResponse.json();
|
|
214
|
+
// The first result is Paris, Lyon or Marseille, we want get all arrondissements
|
|
215
|
+
if (cityResult.length > 0 && ['75', '13', '69'].includes(cityResult[0].codeDepartement)) {
|
|
216
|
+
const url = `${MUNICIPALITY_API_URL}?nom=${searchValue}&codeDepartement=${cityResult[0].codeDepartement}${FIELDS}${BOOST}${TYPES}&limit=21`;
|
|
217
|
+
const arrondissementsResponse = yield customFetch(url);
|
|
218
|
+
const arrondissementsResult = yield arrondissementsResponse.json();
|
|
219
|
+
const filtredAndSortArrondissementsResult = arrondissementsResult
|
|
220
|
+
.reduce((acc, item) => {
|
|
221
|
+
if (['75056', '13055', '69123'].includes(item.code))
|
|
222
|
+
return acc;
|
|
223
|
+
return [
|
|
224
|
+
...acc,
|
|
225
|
+
Object.assign(Object.assign({}, item), { codesPostaux: [item.codesPostaux[0]] }),
|
|
226
|
+
];
|
|
227
|
+
}, [])
|
|
228
|
+
.sort((a, b) => parseInt(a.codesPostaux[0]) - parseInt(b.codesPostaux[0]));
|
|
229
|
+
CURRENT_RESULT = filtredAndSortArrondissementsResult;
|
|
230
|
+
if (isStartsWith(SPECIAL_CITIES, searchValue.toLowerCase())) {
|
|
231
|
+
const filtredCurrentResult = filterOnCurrentResult(searchValue);
|
|
232
|
+
return formatToMunicipalitySearchResult(filtredCurrentResult);
|
|
233
|
+
}
|
|
234
|
+
return formatToMunicipalitySearchResult(filterCityResults([...filtredAndSortArrondissementsResult, ...cityResult]));
|
|
216
235
|
}
|
|
217
|
-
return formatToMunicipalitySearchResult(filterCityResults(
|
|
236
|
+
return formatToMunicipalitySearchResult(filterCityResults(cityResult));
|
|
237
|
+
}
|
|
238
|
+
catch (error) {
|
|
239
|
+
if (error instanceof DOMException && error.name === 'AbortError') {
|
|
240
|
+
return [];
|
|
241
|
+
}
|
|
242
|
+
throw error;
|
|
218
243
|
}
|
|
219
|
-
return formatToMunicipalitySearchResult(filterCityResults(cityResult));
|
|
220
244
|
});
|
|
221
245
|
|
|
222
246
|
const searchByZipcode = (searchValue, options) => __awaiter(void 0, void 0, void 0, function* () {
|
|
223
247
|
const url = `${MUNICIPALITY_API_URL}?codePostal=${searchValue}${FIELDS}${BOOST}${TYPES}`;
|
|
224
248
|
const signal = (options === null || options === void 0 ? void 0 : options.signal) || getSignal();
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
249
|
+
try {
|
|
250
|
+
const zipCodeResponse = yield customFetch(url, Object.assign(Object.assign({}, options), { signal }));
|
|
251
|
+
const zipCodeResult = yield zipCodeResponse.json();
|
|
252
|
+
const filtredZipCodeResult = zipCodeResult.filter(item => !['75056', '13055', '69123'].includes(item.code));
|
|
253
|
+
return formatToMunicipalitySearchResult(filtredZipCodeResult);
|
|
254
|
+
}
|
|
255
|
+
catch (error) {
|
|
256
|
+
if (error instanceof DOMException && error.name === 'AbortError') {
|
|
257
|
+
return [];
|
|
258
|
+
}
|
|
259
|
+
throw error;
|
|
260
|
+
}
|
|
229
261
|
});
|
|
230
262
|
|
|
231
263
|
const convertFirstLetterToUpperCase = (str) => {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchByAddress.d.ts","sourceRoot":"","sources":["../src/searchByAddress.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAalE,eAAO,MAAM,eAAe,gBACb,MAAM,YACT,kBAAkB,KAC3B,QAAQ,mBAAmB,EAAE,
|
|
1
|
+
{"version":3,"file":"searchByAddress.d.ts","sourceRoot":"","sources":["../src/searchByAddress.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAC;AAalE,eAAO,MAAM,eAAe,gBACb,MAAM,YACT,kBAAkB,KAC3B,QAAQ,mBAAmB,EAAE,CA8B/B,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchByDepartment.d.ts","sourceRoot":"","sources":["../src/searchByDepartment.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,kBAAkB,EAAE,sBAAsB,EAC7C,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,kBAAkB,gBAChB,MAAM,YACT,kBAAkB,KAC3B,QAAQ,sBAAsB,EAAE,
|
|
1
|
+
{"version":3,"file":"searchByDepartment.d.ts","sourceRoot":"","sources":["../src/searchByDepartment.ts"],"names":[],"mappings":"AAGA,OAAO,EACH,kBAAkB,EAAE,sBAAsB,EAC7C,MAAM,SAAS,CAAC;AAEjB,eAAO,MAAM,kBAAkB,gBAChB,MAAM,YACT,kBAAkB,KAC3B,QAAQ,sBAAsB,EAAE,CAmClC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchByMunicipality.d.ts","sourceRoot":"","sources":["../src/searchByMunicipality.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAgB,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAoBrF,eAAO,MAAM,oBAAoB,gBAClB,MAAM,YACT,kBAAkB,KAC3B,QAAQ,wBAAwB,EAAE,
|
|
1
|
+
{"version":3,"file":"searchByMunicipality.d.ts","sourceRoot":"","sources":["../src/searchByMunicipality.ts"],"names":[],"mappings":"AAKA,OAAO,EAAE,kBAAkB,EAAgB,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAoBrF,eAAO,MAAM,oBAAoB,gBAClB,MAAM,YACT,kBAAkB,KAC3B,QAAQ,wBAAwB,EAAE,CAsDpC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"searchByZipcode.d.ts","sourceRoot":"","sources":["../src/searchByZipcode.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAgB,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAErF,eAAO,MAAM,eAAe,gBACb,MAAM,YACT,kBAAkB,KAC3B,QAAQ,wBAAwB,EAAE,
|
|
1
|
+
{"version":3,"file":"searchByZipcode.d.ts","sourceRoot":"","sources":["../src/searchByZipcode.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,kBAAkB,EAAgB,wBAAwB,EAAE,MAAM,SAAS,CAAC;AAErF,eAAO,MAAM,eAAe,gBACb,MAAM,YACT,kBAAkB,KAC3B,QAAQ,wBAAwB,EAAE,CAiBpC,CAAA"}
|