example export async function splitRequestBy100 ( ids , cb ) { if ( ! ids || ! Array . isArray ( ids ) || ! ids . length ) { return [ ] ; } if ( ids . length < 100 ) { return cb ( ids . join ( ',' ) ) ; } const chunk = 100 ; const subReqs = [ ] as any [ ] ; for ( let i = 0 ; i < ids . length ; i += chunk ) { const preparedIds = ids . slice ( i , i + chunk ) ; subReqs . push ( cb ( preparedIds . join ( ',' ) ) ) ; } const reqs = await Promise . all ( subReqs ) ; return [ ] . concat ( ... reqs ) ; }