import {selectCollapsedFrom} from '@augment-vir/common';
selectCollapsedFrom(
[
{
child: {
grandChild: 'hi',
grandChild2: 3,
grandChild3: /something/,
},
},
{
child: {
grandChild: 'hi',
grandChild2: 4,
grandChild3: /something/,
},
},
],
{
child: {
grandChild2: true,
},
},
);
// output is `[3, 4]`
The same as selectFrom except that the final output is collapsed until the first nested value that has more than 1 key or that is not an object.