diff --git a/index.js b/index.js index 2e4b1c1ec5c210c3c21088c693b899ff7fbab61d..1faf750cd85840175c58f79830f1275ed643bdd1 100644 --- a/index.js +++ b/index.js @@ -247513,6 +247513,12 @@ async function getInseeCode(postalCode, city) { sanitizeCity(commune.nomCommune).includes(parsedCity) ) + if (filteredResponse.length > 1) { + throw new Error( + 'Input city is not precise enough, more than one city was found' + ) + } + return filteredResponse[0].codeCommune } } catch (error) {