code: function(params) {
      var keys = _.keysIn(
                    _.pick(
                      params,
                      ['fieldSelector', 'labelSelector'])
                  ).sort();
      return _.reduce(
              keys,
              function(result, key, i) {
                return result + key + '=' + encodeURIComponent(params[key]) +
                        ((i < (keys.length-1)) ? '&' : '');
              }, '?');
  
    }
docs: will take an object, filter & sort it for consistent unique key generation uses encodeURIComponent internally because keys can have special characters, such as '='