Travis build: 1896

This commit is contained in:
30secondsofcode
2020-04-16 20:16:20 +00:00
parent 72bd003b81
commit 5fbf193e3a
12 changed files with 86 additions and 91 deletions

View File

@ -14,13 +14,13 @@ const deepMapKeys = (obj, f) =>
Array.isArray(obj)
? obj.map(val => deepMapKeys(val, f))
: typeof obj === 'object'
? Object.keys(obj).reduce((acc, current) => {
? Object.keys(obj).reduce((acc, current) => {
const val = obj[current];
acc[f(current)] =
val !== null && typeof val === 'object' ? deepMapKeys(val, f) : (acc[f(current)] = val);
return acc;
}, {})
: obj;
: obj;
```
```js