( outputValidator: TType<T>, data: T, extractedType: TType<U>, )
| 77 | } |
| 78 | |
| 79 | function extractIDsFromPayload<T, U>( |
| 80 | outputValidator: TType<T>, |
| 81 | data: T, |
| 82 | extractedType: TType<U>, |
| 83 | ): $ReadOnlyArray<U> { |
| 84 | const result = new Set<U>(); |
| 85 | const conversionFunction = (id: U) => { |
| 86 | result.add(id); |
| 87 | return id; |
| 88 | }; |
| 89 | |
| 90 | try { |
| 91 | convertObject(outputValidator, data, [extractedType], conversionFunction); |
| 92 | } catch {} |
| 93 | |
| 94 | return [...result]; |
| 95 | } |
| 96 | |
| 97 | type ConvertObjectOptions = { |
| 98 | +dontValidateInput?: ?boolean, |
no test coverage detected