fix: Fix error due to Typescript 3.5.1

decamelizeKeys is defined to return Object, but Typescript 3.5.1 is a
bit stricter about Object and indexing properties. The correct fix
would need to be done in the type definition of humps.
This commit is contained in:
Daniel Rose 2019-06-12 13:29:18 +02:00
parent 8f5fec52ce
commit 5474f0658f

View File

@ -28,7 +28,7 @@ function defaultRequest(service: any, { body, query, sudo, method }) {
headers,
method: (method === 'stream') ? 'get' : method,
onProgress: (method === 'stream') ? () => {} : undefined,
searchParams: stringify(decamelizeKeys(query || {}), { arrayFormat: 'bracket' }),
searchParams: stringify(decamelizeKeys(query || {}) as any, { arrayFormat: 'bracket' }),
prefixUrl: service.url,
json: typeof body === 'object' ? decamelizeKeys(body, skipAllCaps) : body,
rejectUnauthorized: service.rejectUnauthorized,