Why not map all entries and build an object?
object = Object.fromEntries(data.map(({ key, value }) => [key, value]));