more refactoring
This commit is contained in:
@ -13,10 +13,7 @@ const dig = (obj, target) =>
|
|||||||
.values(obj)
|
.values(obj)
|
||||||
.reduce((acc, val) => {
|
.reduce((acc, val) => {
|
||||||
if (acc !== undefined) return acc;
|
if (acc !== undefined) return acc;
|
||||||
if (typeof val === 'object') {
|
if (typeof val === 'object') return dig(val, target);
|
||||||
const v = dig(val, target);
|
|
||||||
return v === undefined ? undefined : v;
|
|
||||||
}
|
|
||||||
}, undefined);
|
}, undefined);
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user