all
Passes when every guard passes, in order.
Passes when every guard passes, in order. The first one that throws (or returns false) stops the
chain, so a later guard never runs for a request an earlier one refused.
Import#
ts
import { all } from "@shadow-js/dusk/server";
Signature#
ts
function all(...guards: readonly Guard[]): Guard
Parameters#
| Name | Description |
|---|---|
guards |
The guards to run. |
Returns#
One guard.
Throws#
- The request signal's reason when cancellation precedes a guard or its awaited result.
Examples#
ts
serverFn({ guard: all(requireUser, requireAdmin) }, handler);