File tree Expand file tree Collapse file tree 2 files changed +5
-2
lines changed
Expand file tree Collapse file tree 2 files changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -77,14 +77,14 @@ export default class Curseforge {
7777 /**
7878 * Get multiple available games.
7979 * @param index Optional index to use for paging.
80- * @param pageSize Size to show per page.
80+ * @param pageSize Size to show per page. Maximum is 50.
8181 * @returns A Promise with a paging property filled with the Pagination.
8282 */
8383 public get_games ( index ?: number , pageSize ?: number ) : Promise < Game [ ] & { paging : Pagination } > {
8484 return new Promise ( async ( resolve , reject ) => {
8585 let url = new URL ( this . API_URL + "games" ) ;
8686 if ( index ) url . searchParams . set ( "index" , index . toString ( ) ) ;
87- if ( pageSize ) url . searchParams . set ( "pageSize" , pageSize . toString ( ) ) ;
87+ if ( pageSize ) url . searchParams . set ( "pageSize" , Math . max ( pageSize , 50 ) . toString ( ) ) ;
8888 let res = await utils . get ( url . href ) ;
8989
9090 switch ( res . code ) {
Original file line number Diff line number Diff line change @@ -9,6 +9,9 @@ export type GameAssets = {
99
1010export type Pagination = {
1111 index : number ,
12+ /**
13+ * Maximum allowed PageSize is 50.
14+ */
1215 pageSize : number ,
1316 resultCount : number ,
1417 totalCount : number
You can’t perform that action at this time.
0 commit comments