regions.js
function getOrSetRegionKey(region) {
  const regionName = region ? region : getRegion();
  let regionKey = regionKeysByRegion.get(regionName);
  if (!regionKey) {
    regionKey = {region: regionName};
    regionKeysByRegion.set(regionName, regionKey);
  }
  return regionKey;
}
function getOrSetRegionKey(region) {
  const regionName = region ? region : getRegion();
  let regionKey = regionKeysByRegion.get(regionName);
  if (!regionKey) {
    regionKey = {region: regionName};
    regionKeysByRegion.set(regionName, regionKey);
  }
  return regionKey;
}
function getOrSetRegionKey ( region ) { const regionName = region ? region : getRegion ( ) ; let regionKey = regionKeysByRegion . get ( regionName ) ; if ( ! regionKey ) { regionKey = { region : regionName } ; regionKeysByRegion . set ( regionName , regionKey ) ; } return regionKey ; }
Returns the existing region key object or sets & returns a new region key object for the given region name.
@param {string|undefined} [region] - the name of the region (defaults to current region if not defined)
@returns {{region: string}} a region key object
Returns the existing region key object or sets & returns a new region key object for the given region name .