Skip to content
This repository was archived by the owner on Oct 15, 2024. It is now read-only.

Commit 60a7844

Browse files
committed
fix: sanitizeLimit should not return default limit when input is 0
1 parent abe8984 commit 60a7844

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/find-paginated.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -147,7 +147,7 @@ export const findPaginated = async <TDocument extends BaseDocument>(
147147
// =====
148148

149149
export const sanitizeLimit = (limit: number | null | undefined): number => {
150-
return Math.max(1, limit || defaultLimit)
150+
return Math.max(1, limit ?? defaultLimit)
151151
}
152152

153153
export const decodeCursor = (cursorString: string): CursorObject => {

0 commit comments

Comments
 (0)