x = { foo: [ { foo: 'foo' } ], bar: [ { bar: 'bar' } ] };
Is it possible to get {foo: 'foo'} and { bar: 'bar' } in one line?
Something like this
({ foo, bar } = x);
would produce [{"foo":"foo"}] [{"bar":"bar"}] which are two arrays and not objects. Of course these arrays can be further destructured, but I'm interested in a one line implementation
const { foo: [foo], bar: [bar] } = x