function sortObject(obj) {
  return Object.keys(obj).sort().reduce(function(result, key) {
    // @ts-expect-error
    result[key] = obj[key];
    return result;
  }, {});
}
@param {Record<any, any>} obj
@return {Record<any, any>}