diff --git a/index.js b/index.js index 0a34b79b5a1835e4de4056135379f4546263db6b..f66c9dd535eda1a7355fd1963113d35d3d29c6ef 100644 --- a/index.js +++ b/index.js @@ -247508,6 +247508,7 @@ async function getInseeCode(postalCode, city) { if (!city) throw new Error('No city') const parsedCity = sanitizeCity(city) + console.log(parsedCity) const filteredResponse = response.data.filter( town => sanitizeCity(town.nomCommune) === parsedCity @@ -247532,7 +247533,7 @@ function sanitizeCity(city) { return city .toLowerCase() .replace(/\bst\b/i, 'saint') - .replace(/[âêîôûäëïü-\sʼ'éèç]/g, match => REPLACE_CHARS[match]) + .replace(/[âêîôûäëïü-\sʼ'’éèç]/g, match => REPLACE_CHARS[match]) .trim() } @@ -247551,6 +247552,7 @@ const REPLACE_CHARS = { ' ': '', ʼ: '', "'": '', + '’': '', é: 'e', è: 'e', ç: 'c',