function getCount(obj) {
  let rv = 0;
  for (const key in obj) {
    rv++;
  }
  return rv;
}
Returns the number of key-value pairs in the object map.
@param {?Object} obj The object for which to get the number of key-value
    pairs.
@return {number} The number of key-value pairs in the object map.