function identifyPaths()

in lib/environmentConfigurationResolver.js [37:60]


function identifyPaths(node, prefix) {
  prefix = prefix !== undefined ? prefix + '.' : '';
  const paths = {};
  for (const property in node) {
    const value = node[property];
    if (typeof value === 'object') {
      Object.assign(paths, identifyPaths(value, prefix + property));
      continue;
    }
    if (typeof value !== 'string') {
      continue;
    }
    const envUrl = getUrlIfEnvironmentVariable(value);
    if (!envUrl) {
      continue;
    }
    const originalHostname = value.substr(value.indexOf(envProtocol) + envProtocol.length + 2, envUrl.hostname.length);
    if (originalHostname.toLowerCase() === envUrl.hostname.toLowerCase()) {
      envUrl.hostname = originalHostname;
    }
    paths[prefix + property] = envUrl;
  }
  return paths;
}