function sortObjectByKey(obj) {
  return Object.keys(obj)
    .sort() // sort twice to get predictable, case insensitive order
    .sort((a, b) => a.localeCompare(b, 'en', {sensitivity: 'base'}))
    .reduce((idx, tag) => {
      idx[tag] = obj[tag];
      return idx;
    }, {});
}
Returns the object with the keys inserted in alphabetic order.
When exporting with `JSON.stringify(obj)` the keys are sorted.
@param {Object<string, *>} obj Any object
@return {Object<string, *>} New object