src/provider/handler/getMatchBox/getMatchbox.js
// map through all c_types and returns sorted combined result
map through all c_types and returns sorted combined result
map through all c_types and returns sorted combined result
async function responseMapper(url, c_types, ex_game_id, game_list) {
  const promises = c_types.map(
    async c_type =>
      await axios.get(`${url}?game_list=${game_list}&c_type=${c_type}`)
  );
  const response = await Promise.all(promises);
  const b = flatten(
    await Promise.all(
      response.map(async item => {
        const rawData = parseXML(item.data);
        const parsedData = rawData.Games.Game
          ? parseData(rawData.Games.Game, ex_game_id, c_types.join(', '))
          : [];
        const a = parsedData.map(async item => {
          if (item.extensions.status === '3') {
            const liveItem = await getLiveData(item, ex_game_id);
            return liveItem;
          } else return item;
        });
        return await Promise.all(a);
      })
    )
  );
  return b;
}
async function responseMapper ( url , c_types , ex_game_id , game_list ) { const promises = c_types . map ( async c_type => await axios . get ( ` ${ url } ${ game_list } ${ c_type } ` ) ) ; const response = await Promise . all ( promises ) ; const b = flatten ( await Promise . all ( response . map ( async item => { const rawData = parseXML ( item . data ) ; const parsedData = rawData . Games . Game ? parseData ( rawData . Games . Game , ex_game_id , c_types . join ( ', ' ) ) : [ ] ; const a = parsedData . map ( async item => { if ( item . extensions . status === '3' ) { const liveItem = await getLiveData ( item , ex_game_id ) ; return liveItem ; } else return item ; } ) ; return await Promise . all ( a ) ; } ) ) ) ; return b ; }
map through all c_types and returns sorted combined result
map through all c_types and returns sorted combined result