Skip to content

Commit a8cf32d

Browse files
committed
feat: camelize fetch result
1 parent 0c52157 commit a8cf32d

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

packages/fetch/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
},
2828
"dependencies": {
2929
"http-errors": "^1.7.1",
30+
"humps": "^2.0.1",
3031
"lodash": "^4.17.11",
3132
"node-fetch": "^2.2.0",
3233
"qs": "^6.5.2"

packages/fetch/src/wrapper.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import qs from "qs";
22
import { pickBy, identity } from "lodash";
33
import createError from "http-errors";
4+
import { camelizeKeys } from "humps";
45

56
/**
67
* A wrapper of fetch
@@ -45,5 +46,5 @@ export default async function(url, opt = {}) {
4546
if (!res.ok) throw createError(res.status, result.body);
4647

4748
res.headers.forEach((val, key) => (result.headers[key] = val));
48-
return result;
49+
return camelizeKeys(result);
4950
}

0 commit comments

Comments
 (0)