checkContext
Restrict a hook to run for certain methods and method types.
ts
import { checkContext } from 'feathers-utils/utils';Type declaration
ts
/**
* Restrict a hook to run for certain methods and method types.
*
* @see https://utils.feathersjs.com/utils/check-context.html
*/
export declare function checkContext<H extends HookContext = HookContext>(
context: H,
type?: HookType | HookType[] | null,
methods?: MethodName | MethodName[] | null,
label?: string,
): void| Argument | Type | Description |
|---|---|---|
| context | H | |
| type | HookType | HookType[] | null | |
| methods | MethodName | MethodName[] | null | |
| label | any |
