import {selectFrom} from '@augment-vir/common';
selectFrom(
[
{
child: {
grandChild: 'hi',
grandChild2: 3,
grandChild3: /something/,
},
},
{
child: {
grandChild: 'hi',
grandChild2: 4,
grandChild3: /something/,
},
},
],
{
child: {
grandChild2: true,
},
},
);
// output is `[{child: {grandChild2: 3}}, {child: {grandChild2: 4}}]`
Performs a SQL-like nested selection on an object, extracting the selected values.