(ctx)
| 16 | * @returns {string} the translated text |
| 17 | */ |
| 18 | export function response(ctx) { |
| 19 | const { result } = ctx; |
| 20 | if (result.statusCode !== 200) { |
| 21 | return util.appendError(result.body, `${result.statusCode}`); |
| 22 | } |
| 23 | const body = JSON.parse(result.body); |
| 24 | return body.TranslatedText; |
| 25 | } |
| 26 | |
| 27 | /** |
| 28 | * Sends a request to the Translate service |
nothing calls this directly
no outgoing calls
no test coverage detected