code: function sortIndexes(indexes, sort) {
  	function compare(a, b) {
  		return a > b ? -1 : (b > a ? 1 : 0);
  	}
  
  	// format: [{ name: 'colName', direction: 'asc' }, { name: 'colName2', direction: 'desc' }]
  	// direction is 'asc' by default
  
  	indexes.sort(function (a, b) {
  		var result = 0;
  
  		for (var i = 0; i < sort.length && result === 0; i++) {
  			var prop = sort[i].name;
  			var factor = sort[i].direction === 'desc' ? -1 : 1;
  
  			result = factor * compare(a[prop], b[prop]);
  		}
  
  		return result;
  	});
  }
docs: Archivist bindings for the FileVault API