dist/util.js
function detectRecursion(o1, o2, f) {
  if (arguments.length === 2) {
    f = o2;o2 = undefined;
  }

  if (seen(o1, o2)) {
    return true;
  } else {
    mark(o1, o2);
    try {
      f();
    } finally {
      unmark(o1, o2);
    }
    return false;
  }
}
function detectRecursion(o1, o2, f) {
  if (arguments.length === 2) {
    f = o2;o2 = undefined;
  }

  if (seen(o1, o2)) {
    return true;
  } else {
    mark(o1, o2);
    try {
      f();
    } finally {
      unmark(o1, o2);
    }
    return false;
  }
}
Internal: Used to detect cases of recursion on the same pair of objects. Returns `true` if the given objects have already been seen. Otherwise the given function is called and `false` is returned.  This function is used internally when traversing objects and arrays to avoid getting stuck in infinite loops when circular objects are encountered. It should be wrapped around all recursive function calls where a circular object may be encountered. See `Transis.eq` for an example.  o1 - The first object to check for recursion. o2 - The paired object to check for recursion (default: `undefined`). f  - A function that make the recursive funciton call.  Returns `true` if recursion on the given objects has been detected. If the given pair of objects has yet to be seen, calls `f` and returns `false`.