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

Function pageOf

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

Source from the content-addressed store, hash-verified

273 * set that appears only when a filter is present.
274 */
275const pageOf = <T>(rows: readonly T[], options: AdminUsersListOptions): readonly T[] => {
276 const offset = Math.max(Math.floor(options.offset ?? 0), 0);
277 if (options.limit === undefined) return rows.slice(offset);
278 return rows.slice(offset, offset + Math.max(Math.floor(options.limit), 1));
279};
280
281/**
282 * The `?email=` read, as a KEYED lookup.

Callers 1

selectByEmailFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected