dist/objectsort.js
function ObjectSort(array, columns, order)
{
	//Check the columns
	if(typeof columns === 'undefined')
	{
		//Create the columns array
		var columns = [];

		//Add the keys
		for(var key in array[0]){ columns.push(key); }
	}

	//Check if columns is not an array
	else if(Array.isArray(columns) === false)
	{
		//Convert it to array
		columns = [columns];
	}

	//Check the order
	if(typeof order === 'undefined')
	{
		//Create the order array
		var order = [];

		//Add ASC order
		for(var i = 0; i < columns.length; i++){ order.push('ASC'); }
	}

	//Check if order is not an array
	else if(Array.isArray(order) === false)
	{
		//Convert it to array
		order = [order];
	}

	//Else, check for lowercase
	else
	{
		//Add the order to uppercase
		for(var i = 0; i < order.length; i++){ order[i] = order[i].toUpperCase(); }
	}

	//Check the order array length
	if(order.length < columns.length)
	{
		//Complete the order array
		for(var i = order.length; i < columns.length; i++){ order.push('ASC'); }
	}

	//Sort the array
	array.sort(function(left, right){ return Compare(left, right, columns, order); });

	//Return the array
	return array;
}
function ObjectSort(array, columns, order)
{
	//Check the columns
	if(typeof columns === 'undefined')
	{
		//Create the columns array
		var columns = [];

		//Add the keys
		for(var key in array[0]){ columns.push(key); }
	}

	//Check if columns is not an array
	else if(Array.isArray(columns) === false)
	{
		//Convert it to array
		columns = [columns];
	}

	//Check the order
	if(typeof order === 'undefined')
	{
		//Create the order array
		var order = [];

		//Add ASC order
		for(var i = 0; i < columns.length; i++){ order.push('ASC'); }
	}

	//Check if order is not an array
	else if(Array.isArray(order) === false)
	{
		//Convert it to array
		order = [order];
	}

	//Else, check for lowercase
	else
	{
		//Add the order to uppercase
		for(var i = 0; i < order.length; i++){ order[i] = order[i].toUpperCase(); }
	}

	//Check the order array length
	if(order.length < columns.length)
	{
		//Complete the order array
		for(var i = order.length; i < columns.length; i++){ order.push('ASC'); }
	}

	//Sort the array
	array.sort(function(left, right){ return Compare(left, right, columns, order); });

	//Return the array
	return array;
}
function ObjectSort ( array , columns , order ) { //Check the columns
 if ( typeof columns === 'undefined' ) { //Create the columns array
 var columns = [ ] ; //Add the keys
 for ( var key in array [ 0 ] ) { columns . push ( key ) ; } } //Check if columns is not an array
 else if ( Array . isArray ( columns ) === false ) { //Convert it to array
 columns = [ columns ] ; } //Check the order
 if ( typeof order === 'undefined' ) { //Create the order array
 var order = [ ] ; //Add ASC order
 for ( var i = 0 ; i < columns . length ; i ++ ) { order . push ( 'ASC' ) ; } } //Check if order is not an array
 else if ( Array . isArray ( order ) === false ) { //Convert it to array
 order = [ order ] ; } //Else, check for lowercase
 else { //Add the order to uppercase
 for ( var i = 0 ; i < order . length ; i ++ ) { order [ i ] = order [ i ] . toUpperCase ( ) ; } } //Check the order array length
 if ( order . length < columns . length ) { //Complete the order array
 for ( var i = order . length ; i < columns . length ; i ++ ) { order . push ( 'ASC' ) ; } } //Sort the array
 array . sort ( function ( left , right ) { return Compare ( left , right , columns , order ) ; } ) ; //Return the array
 return array ; }
Sort main function
Sort main function