const sortObject = obj => Object.keys(obj) .sort() .reduce( (acc, curr) => ({ ...acc, [curr]: obj[curr], }), {} )