more refactoring

This commit is contained in:
Henry Szeto
2018-07-09 23:17:41 -07:00
parent ab1d0ed9c8
commit 9176acf753

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);
```