(options: EoRequest, headers: EoHeaders, shouldTransformKeys: boolean)
| 113 | } |
| 114 | |
| 115 | const processRequestBody = (options: EoRequest, headers: EoHeaders, shouldTransformKeys: boolean) => { |
| 116 | let newBody: { [k: string]: unknown } | undefined |
| 117 | if (shouldTransformKeys && isJsonHttp(headers) && options.eoBody) { |
| 118 | newBody = keysToSnake(options.eoBody, options.eoTransformKeys as string[]) as { [k: string]: unknown } |
| 119 | } |
| 120 | |
| 121 | if (isJsonHttp(headers) && (newBody || options.eoBody)) { |
| 122 | options.body = JSON.stringify(trimStringValuesInObject(newBody || options.eoBody)) |
| 123 | } |
| 124 | return options.body |
| 125 | } |
| 126 | |
| 127 | const DEFAULT_HEADERS = { |
| 128 | 'Content-Type': 'application/json', |
no test coverage detected