function query( opts ) {
	var qs = [];
	if ( opts.type ) {
		qs.push( 'type='+opts.type );
		delete opts.type;
	} else {
		if ( opts.visibility ) {
			qs.push( 'visibility='+opts.visibility );
			delete opts.visibility;
		}
		if ( opts.affiliation ) {
			qs.push( 'affiliation='+opts.affiliation );
			delete opts.affiliation;
		}
	}
	if ( opts.sort ) {
		qs.push( 'sort='+opts.sort );
		delete opts.sort;
	}
	if ( opts.direction ) {
		qs.push( 'direction='+opts.direction );
		delete opts.direction;
	}
	return qs.join( '&' );
}
Returns a query string based on provided options.

@param {Object} [opts] - function options
@param {string} [opts.type] - repository type
@param {string} [opts.sort] - sort method
@param {string} [opts.direction] - sort direction
@param {string} [opts.visibility] - repository visibility
@param {string} [opts.affiliation] - repository affiliation
@returns {string} query string