async function getNodeContentAndReferences (currentNode, allData, specRoot, version, rootMainKeys,
  commonPathFromData, globalReferences, remoteRefResolver) {
  let graphAdj = [],
    missingNodes = [],
    nodeContent,
    parseResult;

  if (currentNode.parsed) {
    nodeContent = currentNode.parsed.oasObject;
  }
  else {
    parseResult = parseFile(currentNode.content);
    if (parseResult.result === false) {
      return { graphAdj, missingNodes, undefined, nodeReferenceDirectory: {}, nodeName: currentNode.fileName };
    }
    nodeContent = parseResult.oasObject;
  }

  const { referencesInNode, nodeReferenceDirectory } = await getReferences(
    nodeContent,
    currentNode.fileName !== specRoot.fileName,
    removeLocalReferenceFromPath,
    currentNode.fileName,
    version,
    rootMainKeys,
    commonPathFromData,
    allData,
    globalReferences,
    remoteRefResolver
  );

  referencesInNode.forEach((reference) => {
    let referencePath = reference.path,
      adjacentNode = findNodeFromPath(calculatePath(currentNode.fileName, referencePath), allData);

    if (adjacentNode) {
      graphAdj.push(adjacentNode);
    }
    else if (!comparePaths(referencePath, specRoot.fileName)) {
      let calculatedPathForMissing = calculatePathMissing(currentNode.fileName, referencePath);
      if (!calculatedPathForMissing.$ref) {
        missingNodes.push({ path: calculatedPathForMissing.path });
      }
      else {
        missingNodes.push({ $ref: calculatedPathForMissing.$ref, path: null });
      }
    }
  });

  return { graphAdj, missingNodes, nodeContent, nodeReferenceDirectory, nodeName: currentNode.fileName };
}
Maps the output from get root files to detect root files
@param {object} currentNode - current { path, content} object
@param {Array} allData -  array of { path, content} objects
@param {object} specRoot - root file information
@param {string} version - The current version
@param {object} rootMainKeys - A dictionary with the component keys in local components object and its mainKeys
@param {string} commonPathFromData - The common path in the file's paths
@param {object} globalReferences - The accumulated global refernces from all nodes
@param {function} remoteRefResolver - The function that would be called to fetch remote ref contents
@returns {object} - Detect root files result object