(rows: readonly T[], options: AdminUsersListOptions)
| 257 | * set that appears only when a filter is present. |
| 258 | */ |
| 259 | const pageOf = <T>(rows: readonly T[], options: AdminUsersListOptions): readonly T[] => { |
| 260 | const offset = Math.max(Math.floor(options.offset ?? 0), 0); |
| 261 | if (options.limit === undefined) return rows.slice(offset); |
| 262 | return rows.slice(offset, offset + Math.max(Math.floor(options.limit), 1)); |
| 263 | }; |
| 264 | |
| 265 | /** |
| 266 | * The `?email=` read, as a KEYED lookup. |