forked from MapComplete/MapComplete
		
	Better trimming of canonical values, no console output if not actually rewriting
This commit is contained in:
		
							parent
							
								
									80cb9efaf0
								
							
						
					
					
						commit
						e594511e22
					
				
					 2 changed files with 5 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -152,7 +152,7 @@ export class Denomination {
 | 
			
		|||
        if (stripped === null) {
 | 
			
		||||
            return null;
 | 
			
		||||
        }
 | 
			
		||||
        return stripped + " " + this.canonical.trim()
 | 
			
		||||
        return (stripped + " " + this.canonical.trim()).trim();
 | 
			
		||||
    }
 | 
			
		||||
 | 
			
		||||
    /**
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -95,7 +95,10 @@ export default class SimpleMetaTagger {
 | 
			
		|||
                    const value = feature.properties[key]
 | 
			
		||||
                    const [, denomination] = unit.findDenomination(value)
 | 
			
		||||
                    let canonical = denomination?.canonicalValue(value) ?? undefined;
 | 
			
		||||
                    console.log("Rewritten ", key, " from", value, "into", canonical)
 | 
			
		||||
                    if(canonical === value){
 | 
			
		||||
                        break;
 | 
			
		||||
                    }
 | 
			
		||||
                    console.log("Rewritten ", key, ` from '${value}' into '${canonical}'`)
 | 
			
		||||
                    if(canonical === undefined && !unit.eraseInvalid) {
 | 
			
		||||
                        break;
 | 
			
		||||
                    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue