Merge pull request #1295 from RobJN/patch-5

Update SimpleMetaTagger.ts
This commit is contained in:
Pieter Vander Vennet 2023-02-06 00:32:22 +01:00 committed by GitHub
commit e8d9f7d5e8
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -118,6 +118,7 @@ export default class SimpleMetaTaggers {
/*Note: also called by 'UpdateTagsFromOsmAPI'*/ /*Note: also called by 'UpdateTagsFromOsmAPI'*/
const tgs = feature.properties const tgs = feature.properties
let movedSomething = false;
function move(src: string, target: string) { function move(src: string, target: string) {
if (tgs[src] === undefined) { if (tgs[src] === undefined) {
@ -125,6 +126,7 @@ export default class SimpleMetaTaggers {
} }
tgs[target] = tgs[src] tgs[target] = tgs[src]
delete tgs[src] delete tgs[src]
movedSomething = true
} }
move("user", "_last_edit:contributor") move("user", "_last_edit:contributor")
@ -132,7 +134,7 @@ export default class SimpleMetaTaggers {
move("changeset", "_last_edit:changeset") move("changeset", "_last_edit:changeset")
move("timestamp", "_last_edit:timestamp") move("timestamp", "_last_edit:timestamp")
move("version", "_version_number") move("version", "_version_number")
return true return movedSomething
} }
) )
public static country = new CountryTagger() public static country = new CountryTagger()