MCPcopy Create free account
hub / github.com/UsefulSoftwareCo/executor / pageOf

Function pageOf

packages/core/api/src/admin/reads.ts:259–263  ·  view source on GitHub ↗
(rows: readonly T[], options: AdminUsersListOptions)

Source from the content-addressed store, hash-verified

257 * set that appears only when a filter is present.
258 */
259const 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.

Callers 1

selectByEmailFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected