function hasReference(currentNode, seenRef) {
  let hasRef = false;

  traverseUtility(currentNode).forEach(function (property) {
    if (property) {
      let hasReferenceTypeKey;
      hasReferenceTypeKey = Object.keys(property)
        .find(
          (key) => {
            return key === '$ref';
          }
        );
      if (hasReferenceTypeKey && seenRef[property.$ref]) {
        hasRef = true;
      }
    }
  });
  return hasRef;
}
@param {*} currentNode - the object from which you're trying to find references
@param {*} seenRef References that are repeated. Used to identify circular references.
@returns {boolean} - Whether the object has circular references