UNPKG

codes-postaux

Version:
14 lines (10 loc) 264 B
const index = {} for (const entry of require('./codes-postaux.json')) { if (!(entry.codePostal in index)) { index[entry.codePostal] = [] } index[entry.codePostal].push(entry) } exports.find = function (postalCode) { return index[postalCode] || [] }