File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -10,28 +10,11 @@ interface JSONSponsor {
1010 amount : number ;
1111 link : string ;
1212 org : boolean ;
13- /**
14- * The ISO string representing when the sponsorship was created. This can be used to determine how long someone has been sponsoring.
15- */
1613 createdAt ?: string ;
1714
1815 tierTitle : string ;
19- /**
20- * The tier level of the sponsor, where 0 is the lowest tier (e.g. Past Sponsors) and higher numbers indicate higher tiers.
21- */
2216 tierLevel : number ;
23-
24- /**
25- * Determines how the sponsor should be displayed in the website sidebar.
26- * This is only used for sponsors that define a custom `sidebarLogo` in
27- * `SPONSOR_CUSTOMIZATIONS` and meet the amount requirements.
28- */
2917 sidebarSize : SidebarPlacementSize ;
30- /**
31- * The URL of the logo to use for the sponsor's sidebar placement.
32- *
33- * @default The sponsor's avatar URL from GitHub Sponsors.
34- */
3518 sidebarLogo : string ;
3619}
3720
@@ -205,7 +188,16 @@ export default defineConfig({
205188 customization ?. sidebarLogo || sponsorEntry . sponsor . avatarUrl ,
206189 } satisfies JSONSponsor ;
207190 } )
208- . sort ( ( a , b ) => b . amount - a . amount ) ;
191+ . sort ( ( a , b ) => {
192+ const amountDiff = b . amount - a . amount ;
193+ if ( amountDiff !== 0 ) {
194+ return amountDiff ;
195+ }
196+
197+ const createdAtA = a . createdAt ? new Date ( a . createdAt ) . getTime ( ) : 0 ;
198+ const createdAtB = b . createdAt ? new Date ( b . createdAt ) . getTime ( ) : 0 ;
199+ return createdAtA - createdAtB ;
200+ } ) ;
209201
210202 await fs . writeFile ( 'sponsors.json' , `${ JSON . stringify ( json , null , 2 ) } \n` ) ;
211203 } ,
You can’t perform that action at this time.
0 commit comments