code: function getExistingPath(path, existingPaths) {
    return findIndex((existingPath) => equals(existingPath.slice(0, -1), path.slice(0, -1)), existingPaths);
  }
docs: @function getExistingPath
  
  @description
  does the path already exist minus the final item
  
  @param {Array<number|string>} path the path to check
  @param {Array<Array<number|string>>} existingPaths the existing paths
  @returns {number} the index of the existing path