mirror of
				https://github.com/TriliumNext/Notes.git
				synced 2025-11-04 15:11:31 +08:00 
			
		
		
		
	server: Fix build comparator preferring numeric comparators
This commit is contained in:
		
							parent
							
								
									105aa3e5f8
								
							
						
					
					
						commit
						eb39da19b3
					
				@ -33,11 +33,8 @@ const numericComparators: Record<string, Comparator<number>> = {
 | 
				
			|||||||
function buildComparator(operator: string, comparedValue: string) {
 | 
					function buildComparator(operator: string, comparedValue: string) {
 | 
				
			||||||
    comparedValue = comparedValue.toLowerCase();
 | 
					    comparedValue = comparedValue.toLowerCase();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (operator in numericComparators) {
 | 
					    if (operator in numericComparators && !isNaN(+comparedValue)) {
 | 
				
			||||||
        const floatValue = parseFloat(comparedValue);
 | 
					        return numericComparators[operator](parseFloat(comparedValue));
 | 
				
			||||||
        if (!isNaN(floatValue)) {
 | 
					 | 
				
			||||||
            return numericComparators[operator](floatValue);
 | 
					 | 
				
			||||||
        }
 | 
					 | 
				
			||||||
    }
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
    if (operator in stringComparators) {
 | 
					    if (operator in stringComparators) {
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user