function dependencyOnParent(mode) {
    if (!mode) return false;

    return mode.endsWithParent || dependencyOnParent(mode.starts);
  }
Determines if a mode has a dependency on it's parent or not

If a mode does have a parent dependency then often we need to clone it if
it's used in multiple places so that each copy points to the correct parent,
where-as modes without a parent can often safely be re-used at the bottom of
a mode chain.

@param {Mode | null} mode
@returns {boolean} - is there a dependency on the parent?