function separateLocalFromRemotes(chainConfigs, localDomain) {
  let local;
  const remotes = [];

  for (let config of chainConfigs) {
    if (config.domain == localDomain) {
      local = config;
    } else {
      remotes.push(config);
    }
  }

  return {
    local,
    remotes,
  };
}
/*
 * Given a full array of chainConfigs and a target localDomain,
 * return an object where local is the domain specified by localDomain
 * and remotes is an array of all other remote domains
 * thus creating appropriate input parameters for the deployOptics script
 * given an array of all Optics chains
 *
 * @param chainConfigs - ChainConfig[]
 * @param localDomain - domain for the local contract suite
 *
 * @return {
 *    local - ChainConfig for the local domain
 *    remotes - ChainConfig[] for all other domains
 * }
 */
Given a full array of chainConfigs and a target localDomain,
return an object where local is the domain specified by localDomain
and remotes is an array of all other remote domains
thus creating appropriate input parameters for the deployOptics script
given an array of all Optics chains

@param chainConfigs - ChainConfig[]
@param localDomain - domain for the local contract suite

@return {
local - ChainConfig for the local domain
remotes - ChainConfig[] for all other domains
}
Given a full array of chainConfigs and a target localDomain return an object where local is the domain specified by localDomain and remotes is an array of all other remote domains thus creating appropriate input parameters for the deployOptics script given an array of all Optics chains @param chainConfigs - ChainConfig [] @param localDomain - domain for the local contract suite @return { local - ChainConfig for the local domain remotes - ChainConfig [] for all other domains }
function separateLocalFromRemotes(chainConfigs, localDomain) {
  let local;
  const remotes = [];
  for (let config of chainConfigs) {
    if (config.domain == localDomain) {
      local = config;
    } else {
      remotes.push(config);
    }
  }
  return {
    local,
    remotes,
  };
}
function separateLocalFromRemotes ( chainConfigs , localDomain ) { let local ; const remotes = [ ] ; for ( let config of chainConfigs ) { if ( config . domain == localDomain ) { local = config ; } else { remotes . push ( config ) ; } } return { local , remotes , } ; }
Given a full array of chainConfigs and a target localDomain,
 return an object where local is the domain specified by localDomain
 and remotes is an array of all other remote domains
 thus creating appropriate input parameters for the deployOptics script
 given an array of all Optics chains
Given a full array of chainConfigs and a target localDomain return an object where local is the domain specified by localDomain and remotes is an array of all other remote domains thus creating appropriate input parameters for the deployOptics script given an array of all Optics chains