Type predicate for validating a parsed control_response payload * as a BridgePermissionResponse. Checks the required `behavior` * discriminant rather than using an unsafe `as` cast.
( value: unknown, )
| 30 | * as a BridgePermissionResponse. Checks the required `behavior` |
| 31 | * discriminant rather than using an unsafe `as` cast. */ |
| 32 | function isBridgePermissionResponse( |
| 33 | value: unknown, |
| 34 | ): value is BridgePermissionResponse { |
| 35 | if (!value || typeof value !== 'object') return false |
| 36 | return ( |
| 37 | 'behavior' in value && |
| 38 | (value.behavior === 'allow' || value.behavior === 'deny') |
| 39 | ) |
| 40 | } |
| 41 | |
| 42 | export { isBridgePermissionResponse } |
| 43 | export type { BridgePermissionCallbacks, BridgePermissionResponse } |
no outgoing calls
no test coverage detected