const readJson = (filePath) => { return fetch(filePath) .then(response => { if(!response.ok) { throw new Error(`Erreur lors du chargement du fichier JSON : ${response.statusText}`); } return response.json(); }) }; export { readJson };