function ancestors(first, second) {
  var path = [];

  for (var n in first.path) {
    if (first.path[n] === "") continue;
    if (!second.path[n]) break;
    path.push(first.path[n]);
  }
  return path;
}
/**
 * Finds the common ancestor path between two states.
 *
 * @param {Object} first The first state.
 * @param {Object} second The second state.
 * @return {Array} Returns an array of state names in descending order, not including the root.
 */
Finds the common ancestor path between two states.
@param {Object} first The first state.
@param {Object} second The second state.
@return {Array} Returns an array of state names in descending order, not including the root.
Finds the common ancestor path between two states . @param { Object } first The first state . @param { Object } second The second state . @return { Array } Returns an array of state names in descending order not including the root .
function ancestors(first, second) {
  var path = [];
  for (var n in first.path) {
    if (first.path[n] === "") continue;
    if (!second.path[n]) break;
    path.push(first.path[n]);
  }
  return path;
}
function ancestors ( first , second ) { var path = [ ] ; for ( var n in first . path ) { if ( first . path [ n ] === "" ) continue ; if ( ! second . path [ n ] ) break ; path . push ( first . path [ n ] ) ; } return path ; }
Finds the common ancestor path between two states.
Finds the common ancestor path between two states .