insee-municipality-code
Version:
🇫🇷 Get the INSEE municipality code from postal code and name of French municipality
21 lines (16 loc) • 547 B
JavaScript
;
Object.defineProperty(exports, "__esModule", {
value: true
});
var _latinize = require("./latinize");
var _latinize2 = _interopRequireDefault(_latinize);
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
exports.default = (string = "") => {
if (string === null) {
string = "";
}
if (typeof string !== "string") {
string = string.toString();
}
return (0, _latinize2.default)(string).replace(/[^0-9a-zA-Z .,'"]/g, " ").replace(/\s+/g, " ").toUpperCase().trim();
};