function findNodeFromPath(referencePath, allData) {
  const isReferenceRemoteURL = stringIsAValidUrl(referencePath),
    partialComponents = referencePath.split(localPointer),
    isPartial = partialComponents.length > 1;

  let node = allData.find((node) => {
    if (isPartial && !isReferenceRemoteURL) {
      referencePath = partialComponents[0];
    }

    if (isReferenceRemoteURL) {
      return _.startsWith(node.path, referencePath);
    }

    return comparePaths(node.fileName, referencePath);
  });

  return node;
}
Locates a referenced node from the data input by path
@param {string} referencePath - value from the $ref property
@param {Array} allData -  array of { path, content} objects
@returns {object} - Detect root files result object