export const chunksOfArray = < T > ( arr , size ) : T [ ] [ ] => { const matrix = [ ] ; for ( let i = 0 ; i < arr . length ; i += size ) { matrix . push ( arr . slice ( i , i + size ) ) ; } return matrix ; } ;