more refactoring

This commit is contained in:
Henry Szeto
2018-07-09 23:17:41 -07:00
parent 2577e13265
commit 1a3e1dde1e

View File

@ -13,10 +13,7 @@ const dig = (obj, target) =>
.values(obj)
.reduce((acc, val) => {
if (acc !== undefined) return acc;
if (typeof val === 'object') {
const v = dig(val, target);
return v === undefined ? undefined : v;
}
if (typeof val === 'object') return dig(val, target);
}, undefined);
```