Skip to content

Commit 8d6c4f4

Browse files
committed
Remove unecessary function
1 parent 5c6f65e commit 8d6c4f4

File tree

1 file changed

+0
-23
lines changed

1 file changed

+0
-23
lines changed

src/adapter/search-response-adapter/pagination-adapter.ts

Lines changed: 0 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,6 @@
11
import type { MeiliSearchResponse, PaginationContext } from '../../types'
22
import { ceiledDivision } from '../../utils'
33

4-
/**
5-
* Slice the requested hits based on the pagination position.
6-
*
7-
* @param {Record<string} hits
8-
* @param {number} page
9-
* @param {number} hitsPerPage
10-
* @returns {Array}
11-
*/
12-
export function adaptPagination(
13-
hits: Record<string, any>,
14-
page: number,
15-
hitsPerPage: number
16-
): Array<Record<string, any>> {
17-
if (hitsPerPage < 0) {
18-
throw new TypeError(
19-
'Value too small for "hitsPerPage" parameter, expected integer between 0 and 9223372036854775807'
20-
)
21-
}
22-
const start = page * hitsPerPage
23-
return hits.slice(start, start + hitsPerPage)
24-
}
25-
26-
// export function adaptNbPages(): number {}
274
function adaptHitsPerPage(
285
searchResponse: MeiliSearchResponse<Record<string, any>>,
296
paginationContext: PaginationContext

0 commit comments

Comments
 (0)