( viewer: Viewer, inputValidator: ?TType<T>, input: T, )
| 106 | } |
| 107 | |
| 108 | async function checkClientSupported<T>( |
| 109 | viewer: Viewer, |
| 110 | inputValidator: ?TType<T>, |
| 111 | input: T, |
| 112 | ) { |
| 113 | let platformDetails; |
| 114 | if (inputValidator) { |
| 115 | platformDetails = findFirstInputMatchingValidator( |
| 116 | inputValidator, |
| 117 | tPlatformDetails, |
| 118 | input, |
| 119 | ); |
| 120 | } |
| 121 | if (!platformDetails && inputValidator) { |
| 122 | const platform = findFirstInputMatchingValidator( |
| 123 | inputValidator, |
| 124 | tPlatform, |
| 125 | input, |
| 126 | ); |
| 127 | if (platform) { |
| 128 | platformDetails = { platform }; |
| 129 | } |
| 130 | } |
| 131 | if (!platformDetails) { |
| 132 | ({ platformDetails } = viewer); |
| 133 | } |
| 134 | await verifyClientSupported(viewer, platformDetails); |
| 135 | } |
| 136 | |
| 137 | const redactedString = '********'; |
| 138 | const redactedTypes = [tPassword, tCookie]; |
no test coverage detected