let addressListDirectionals={NW:["NORTH WEST","N W","N.W.","NOR OESTE","NORTHWEST","NOROESTE"],NO:["NORD OUEST","N O","NORDOUEST"],NE:["NORTH EAST","N E","NORD EST","NOR ESTE","NORTHEAST","NORDEST","NORESTE"],SE:["SOUTH EAST","S E","SUD EST","SUR ESTE","SOUTHEAST","SUDEST","SURESTE"],SW:["SOUTH WEST","S W","SUR OESTE","SOUTHWEST","SUROESTE"],SO:["SUD OUEST","S O","SUDOUEST"],N:["NORTH","NORD","NORTE"],E:["EAST","EST","ESTE"],S:["SOUTH","SUD","SUR"],W:["WEST","OESTE"],O:["OUEST"]},addressDirectional=(Object.keys(addressListDirectionals).concat(Object.values(addressListDirectionals).flat()).join("|"),address=>{var directional,directionals=[];for(directional of Object.keys(addressListDirectionals)){var val,regex1=new RegExp(`\\b${directional}\\b`,"gi"),regex1=address.match(regex1);regex1&&directionals.push({directional:directional,source:regex1[0],ndx:regex1.index??address.lastIndexOf(regex1[0]),length:regex1[0].length});for(val of addressListDirectionals[directional]){var regex2=new RegExp(`\\b${val}\\b`,"gi"),matches2=address.match(regex2);if(matches2)for(var source of matches2)directionals.push({directional:directional,source:source,ndx:matches2.index??address.lastIndexOf(source),length:source.length})}}return 1a.ndx>b.ndx?1:-1),directionals});exports.addressDirectional=addressDirectional;