Q:

Converting an Object of Arrays into Objects of Objects

Currently my data looks like this
{
    numberOne: [{
        timestamp: 3829383,
        value: 20323.23
    }],
    numberTwo: [{
        timestamp: 2382342,
        value: 120912.1
    }]
    ...
}

And I want to get it into this format
{
    numberOne: {
        timestamp: 3829383,
        value: 20323.23
    },
    numberTwo: {
        timestamp: 2382342,
        value: 120912.1
    }
    ...
}

I've tried Object.assign, .map(), .filter()... nothing seems to work! 
Any thoughts on how I could make this work would be very helpful

A:

Enumerate the entries in the object, pull out the first item in each array and create an object with the key and the item.

const data = { numberOne: [{ timestamp: 3829383, value: 20323.23 }], numberTwo: [{ timestamp: 2382342, value: 120912.1 }] }

const transform = (arr) => 
    Object.entries(arr).reduce((acc,[k,[v]]) => (acc[k] = v, acc), {})

console.log(transform(data))

Or, you can use Object.fromEntries:

const data = { numberOne: [{ timestamp: 3829383, value: 20323.23 }], numberTwo: [{ timestamp: 2382342, value: 120912.1 }] }

const transform = (arr) => 
    Object.fromEntries(Object.entries(arr).map(([k,[v]]) => [k, v]))

console.log(transform(data))

