( platformDetails: ?PlatformDetails, outputValidator: TType<T>, data: T, )
| 61 | } |
| 62 | |
| 63 | async function validateOutput<T>( |
| 64 | platformDetails: ?PlatformDetails, |
| 65 | outputValidator: TType<T>, |
| 66 | data: T, |
| 67 | ): Promise<T> { |
| 68 | if (!outputValidator.is(data)) { |
| 69 | console.trace( |
| 70 | 'Output validation failed, validator is:', |
| 71 | outputValidator.displayName, |
| 72 | ); |
| 73 | return data; |
| 74 | } |
| 75 | |
| 76 | const keyserverID = await thisKeyserverID(); |
| 77 | |
| 78 | if ( |
| 79 | hasMinStateVersion(platformDetails, { |
| 80 | native: 43, |
| 81 | web: 3, |
| 82 | }) |
| 83 | ) { |
| 84 | return convertServerIDsToClientIDs(keyserverID, outputValidator, data); |
| 85 | } |
| 86 | |
| 87 | return data; |
| 88 | } |
| 89 | |
| 90 | function checkInputValidator<T>( |
| 91 | inputValidator: TType<T>, |
no test coverage detected