Skip to content

Commit ecd5c17

Browse files
committed
Update Comments to make clear that there is a pageSize limit of 50
1 parent c564987 commit ecd5c17

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

src/index.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff 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){

src/objects/types.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ export type GameAssets = {
99

1010
export type Pagination = {
1111
index: number,
12+
/**
13+
* Maximum allowed PageSize is 50.
14+
*/
1215
pageSize: number,
1316
resultCount: number,
1417
totalCount: number

0 commit comments

Comments
 (0)