Skip to content

Type Alias: RequirementGuard<A, G> ​

ts
type RequirementGuard<A, G> = A extends readonly [...unknown[], infer Last] ? Last extends object ? X : G : G;

Defined in: packages/core/src/requirements.ts:101

The guard named by the trailing options of guard arguments A (requirePermission('a', { guard: 'api' }) gives 'api'), or G when there is none.

Type Parameters ​

Type Parameter
A extends readonly unknown[]
G extends string

Released under the MIT License. Inspired by spatie/laravel-permission.