You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/api.md
+2-1Lines changed: 2 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -404,7 +404,8 @@ Decorating a controller method with `@Bind()` enables typed injection of `Reques
404
404
-`Hook` — process-local hook registry with `set`, `has`, `get`, `getAll`, `unset`, and `clear`.
405
405
-`Publisher` — registry for `ark publish`: `publishes(group)`, `publishables(filter?)`, `confirm(confirmation)`, `confirmables(package | true)`, and `clear()`. See the [publish guide](/guide/cli#publish).
Copy file name to clipboardExpand all lines: docs/guide/utilities/helpers.md
+18-3Lines changed: 18 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,15 +2,30 @@
2
2
3
3
Small utility functions that can be used across the application for common tasks.
4
4
5
-
## `perPage(query)`
5
+
## `perPage(query, defaults?)`
6
6
7
-
Extracts a safe pagination limit from a query object. Clamps the result between `1` and `50`, defaulting to `15`.
7
+
Extracts a safe pagination limit from a query object. Clamps the result between `1` and `50` or the configured default `maxPerPage`, defaulting to `25` or the configured default `perPage`.
Extracts the current page and a safe pagination limit from a query object. Clamps the resulting `perPage` between `1` and `50` or the configured default `maxPerPage`, defaulting to `25` or the configured default `perPage`.
Copy file name to clipboardExpand all lines: packages/common/README.md
+18-3Lines changed: 18 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -739,15 +739,30 @@ Key exported types from the package:
739
739
740
740
**`src/utils/helpers.ts`**
741
741
742
-
#### `perPage(query)`
742
+
#### `perPage(query, defaults?)`
743
743
744
-
Extracts a safe pagination limit from a query object. Clamps the result between `1` and `50`, defaulting to `15`.
744
+
Extracts a safe pagination limit from a query object. Clamps the result between `1` and `50` or the configured default `maxPerPage`, defaulting to `25` or the configured default `perPage`.
Extracts the current page and a safe pagination limit from a query object. Clamps the resulting `perPage` between `1` and `50` or the configured default `maxPerPage`, defaulting to `25` or the configured default `perPage`.
0 commit comments