@@ -27,7 +27,6 @@ import {chartJsColors} from '../utils/color.ts';
2727import  {sleep } from  ' ../utils.ts' 
2828import  ' chartjs-adapter-dayjs-4/dist/chartjs-adapter-dayjs-4.esm' 
2929import  {fomanticQuery } from  ' ../modules/fomantic/base.ts' 
30- import  type  {Entries } from  ' type-fest' 
3130import  {pathEscapeSegments } from  ' ../utils/url.ts' 
3231
3332const :  Plugin  =  {
@@ -57,6 +56,13 @@ Chart.register(
5756  customEventListener , 
5857); 
5958
59+ type  ContributorsData  =  {
60+   total:  { 
61+     weeks:  Record <string , any >, 
62+   }, 
63+   [other :  string ]:  Record <string , Record <string , any >>, 
64+ } 
65+ 
6066export  default  defineComponent ({
6167  components: {ChartLine , SvgIcon }, 
6268  props: { 
@@ -127,20 +133,20 @@ export default defineComponent({
127133          } 
128134        } while  (response .status  ===  202 ); 
129135        if  (response .ok ) { 
130-           const =  await  response .json (); 
131-           const ... rest } =  data ; 
136+           const =  await  response .json ()  as   ContributorsData ; 
137+           const ... other } =  data ; 
132138          //  below line might be deleted if we are sure go produces map always sorted by keys 
133139          total .weeks  =  Object .fromEntries (Object .entries (total .weeks ).sort ()); 
134140
135-           const =  Object .values (total .weeks )  as   any ; 
141+           const =  Object .values (total .weeks ); 
136142          this .xAxisStart  =  weekValues [0 ].week ; 
137143          this .xAxisEnd  =  firstStartDateAfterDate (new  Date ()); 
138144          const =  startDaysBetween (this .xAxisStart , this .xAxisEnd ); 
139145          total .weeks  =  fillEmptyStartDaysWithZeroes (startDays , total .weeks ); 
140146          this .xAxisMin  =  this .xAxisStart ; 
141147          this .xAxisMax  =  this .xAxisEnd ; 
142148          this .contributorsStats  =  {}; 
143-           for  (const of  Object .entries (rest )  as   Entries < Record < string ,  Record < string ,  any >>> ) { 
149+           for  (const of  Object .entries (other ) ) { 
144150            user .weeks  =  fillEmptyStartDaysWithZeroes (startDays , user .weeks ); 
145151            this .contributorsStats [email ] =  user ; 
146152          } 
0 commit comments