more refactoring
This commit is contained in:
@ -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);
|
||||
```
|
||||
|
||||
|
||||
Reference in New Issue
Block a user