feat(route-count): convert map to object

This commit is contained in:
dancingCycle 2022-05-28 16:04:08 +02:00
parent 4581961521
commit cfaa46a162
1 changed files with 7 additions and 3 deletions

View File

@ -16,17 +16,19 @@ async function run() {
debug('run started...') debug('run started...')
const res = await axios.get(URL); const res = await axios.get(URL);
debug('res: '+res); debug('res: '+res);
let MapRoutes=null;
if('data' in res){ if('data' in res){
/*get routes*/ /*get routes*/
const AryRoutes=res.data; const AryRoutes=res.data;
const RouteCount=AryRoutes.length; const RouteCount=AryRoutes.length;
debug('RouteCount: '+RouteCount); debug('RouteCount: '+RouteCount);
/*create map*/ /*create map*/
const MapRoutes=new Map(); MapRoutes=new Map();
/*interate through routes*/ /*interate through routes*/
//TODO for(var i=0;i<RouteCount;i++){ for(var i=0;i<RouteCount;i++){
for(var i=0;i<20;i++){ //TODO clean up for(var i=0;i<20;i++){
debug('i: '+i); debug('i: '+i);
let agencyId=null; let agencyId=null;
let routeId=null; let routeId=null;
@ -48,5 +50,7 @@ async function run() {
} }
debug('MapRoutes size: '+MapRoutes.size); debug('MapRoutes size: '+MapRoutes.size);
} }
const objMap=Mapping.times2Obj(MapRoutes);
debug('objMap count: '+Object.keys(objMap).length);
debug('run done.') debug('run done.')
} }