import { SortDirectionNumber } from '../enums/sortDirectionNumber.enum.js';
export const numericSortComparer = (value1, value2, sortDirection = SortDirectionNumber.neutral, sortColumn, gridOptions) => {
    const checkForUndefinedValues = sortColumn?.valueCouldBeUndefined ?? gridOptions?.cellValueCouldBeUndefined ?? false;
    const x = getSortVal(value1, checkForUndefinedValues);
    const y = getSortVal(value2, checkForUndefinedValues);
    return sortDirection * (x === y ? 0 : x > y ? 1 : -1);
};
function getSortVal(val, checkForUndefinedValues) {
    return isNaN(val) || val === '' || val === null || (checkForUndefinedValues && val === undefined) ? -Infinity : parseFloat(val);
}
//# sourceMappingURL=numericSortComparer.js.map