function sort( data, dir ) {
	if ( dir === 'desc' ) {
		data.sort( descending );
	} else {
		data.sort( ascending );
	}
	return data;
}
Sorts tuple data in a specified direction.

@param {ArrayArray} data - data to sort
@param {string} dir - sort direction
@returns {ArrayArray} sorted data