(
array: Array<T>,
options: { limit?: number; offset?: number } = {},
)
| 191 | * Paginate array |
| 192 | */ |
| 193 | export function paginate<T>( |
| 194 | array: Array<T>, |
| 195 | options: { limit?: number; offset?: number } = {}, |
| 196 | ): Array<T> { |
| 197 | const { limit, offset = 0 } = options |
| 198 | |
| 199 | let result = array.slice(offset) |
| 200 | |
| 201 | if (limit !== undefined) { |
| 202 | result = result.slice(0, limit) |
| 203 | } |
| 204 | |
| 205 | return result |
| 206 | } |
nothing calls this directly
no outgoing calls
no test coverage detected