isValidSuggestion = function(pathTokens, suggestedPathTokens) {
      var valid = true;
      suggestedPathTokens.forEach(function(token, index) {
        if (valid && index < pathTokens.length - 1) {
          switch (token) {
            case '{index}':
              valid = mappings.getIndices().indexOf(pathTokens[index]) >= 0;
              break;
            case '{type}':
              valid = mappings.getTypes(pathTokens[index - 1]).
                      indexOf(pathTokens[index]) >= 0;
              break;
            default:
              valid = pathTokens[index] === token;
          }
        }
      });
      return valid;
    }
Checks if a given path matches the definition and current state of
the path to be autocompleted

@param {Array} pathTokens tokens of path to be autocompleted
@param {Array} suggestedPathTokens tokens of possible suggestion
@returns {boolean} if suggestion is valid