Graphorin API reference v0.1.0
Graphorin API reference / @graphorin/security / / composeGuardrails
Function: composeGuardrails()
ts
function composeGuardrails<TValue>(
guardrails,
value,
ctx): Promise<ComposedGuardrailResult<TValue>>;Defined in: packages/security/src/guardrails/builders.ts:58
Compose a sequence of guardrails into a single check that runs them in order. The first 'block' short-circuits; 'warn' is accumulated; 'rewrite' mutates the in-flight value and continues forward.
The composer never throws: every error path returns ComposedGuardrailResult so the caller can surface structured results without exception handling.
Type Parameters
| Type Parameter | Default type |
|---|---|
TValue | unknown |
Parameters
| Parameter | Type |
|---|---|
guardrails | readonly GuardrailDefinition<TValue>[] |
value | TValue |
ctx | GuardrailContext |
Returns
Promise<ComposedGuardrailResult<TValue>>