var sortDirections = {
DEFAULT: -1,
ASC: 1,
DESC: -1,
};
var numberArrayToSort = [1, 4, 3, 2, 5, 6, 9, 10, 5, 8, 7, 1, 4, 3, 2, 5, 6, 9, 10, 5, 8, 7, 1, 4, 3, 2, 5, 6, 9, 10, 5, 8, 7, 1, 4, 3, 2, 5, 6, 9, 10, 5, 8, 7, 1, 4, 3, 2, 5, 6, 9, 10, 5, 8, 7, 1, 4, 3, 2, 5, 6, 9, 10, 5, 8, 7, 1, 4, 3, 2, 5, 6, 9, 10, 5, 8, 7, 1, 4, 3, 2, 5, 6, 9, 10, 5, 8, 7, 1, 4, 3, 2, 5, 6, 9, 10, 5, 8, 7];
var compare = (lessThan, equalTo) => {
if (equalTo) {
return 0;
}
if (lessThan) {
return -1;
}
return 1;
};
var compareStraight = (a, b) => {
if (a === b) {
return 0;
}
if (a < b) {
return -1;
}
return 1;
};
var compareStraightNumber = (a, b) => a - b;
var primitiveTypeComparator = (a, b) => compare(a < b, a === b);
var genericDirectionComparator = (comparator = primitiveTypeComparator) => (a, b, direction = sortDirections.ASC) => {
return direction * comparator(a, b);
};
var sortByNumberComparator = genericDirectionComparator();
var sortDirectionWrapper = (compareFunc, direction = sortDirections.ASC) => (a, b) => compareFunc(a, b) * direction;
var cleanStraightSort = (direction) => sortDirectionWrapper(compareStraight, direction);
var cleanStraightSortFast = (direction) => sortDirectionWrapper(compareStraightNumber, direction);