- hookGuard<Guard>(guard: Guard, before?: ((beforeResult: {
guard: Guard;
value: unknown;
}) => unknown), after?: ((afterResult: {
guard: Guard;
result: boolean;
value: unknown;
}) => unknown)): Guard
-
Parameters
-
guard: Guard
-
Optional
before: ((beforeResult: {
guard: Guard;
value: unknown;
}) => unknown)
-
- (beforeResult: {
guard: Guard;
value: unknown;
}): unknown
-
Parameters
-
beforeResult: {
guard: Guard;
value: unknown;
}
-
Readonly
guard: Guard
-
Readonly
value: unknown
Returns unknown
-
Optional
after: ((afterResult: {
guard: Guard;
result: boolean;
value: unknown;
}) => unknown)
-
- (afterResult: {
guard: Guard;
result: boolean;
value: unknown;
}): unknown
-
Parameters
-
afterResult: {
guard: Guard;
result: boolean;
value: unknown;
}
-
Readonly
guard: Guard
-
Readonly
result: boolean
-
Readonly
value: unknown
Returns unknown
Returns Guard
Given a Type Guard, returns a Type Guard that does exactly the same Mirrors any given guard regardless of their implementation, including
negateGuard
Example