MCPcopy Create free account
hub / github.com/CommE2E/comm / checkClientSupported

Function checkClientSupported

keyserver/src/utils/validation-utils.js:108–135  ·  view source on GitHub ↗
(
  viewer: Viewer,
  inputValidator: ?TType<T>,
  input: T,
)

Source from the content-addressed store, hash-verified

106}
107
108async 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
137const redactedString = '********';
138const redactedTypes = [tPassword, tCookie];

Callers 2

SocketClass · 0.90
validateInputFunction · 0.85

Calls 2

verifyClientSupportedFunction · 0.90

Tested by

no test coverage detected