UNPKG

international-vehicle-registration-code

Version:

A JS Module and JSON-Map for Car Codes "International vehicle registration code"

23 lines (22 loc) 493 B
var list = require("./CarCountryCodes.json") function regcode() { this.findByName = function(find) { var collect = [] list.forEach(elem => { if(elem.Country.toLowerCase().includes(find.toLowerCase())){ collect.push(elem) } }); return collect; } this.findByCode = function(find) { var collect = [] list.forEach(elem => { if(elem.Code.includes(find.toUpperCase())){ collect.push(elem) } }); return collect; } } module.exports = regcode;