chore: automated housekeeping...

This commit is contained in:
Pieter Vander Vennet 2025-04-26 22:06:59 +02:00
parent 6122d2a42c
commit a2bcfead15
22 changed files with 448 additions and 86 deletions

View file

@ -44,37 +44,37 @@ export class HistoryUtils {
.filter((ch) => ch.oldValue !== ch.value)
}
public static fullHistoryDiff(histories: OsmObject[][], onlyShowUsername?: Set<string>): {
key: string;
value?: string;
oldValue?: string;
public static fullHistoryDiff(
histories: OsmObject[][],
onlyShowUsername?: Set<string>
): {
key: string
value?: string
oldValue?: string
step: OsmObject
}[] {
const allDiffs: {
key: string;
value?: string;
oldValue?: string;
key: string
value?: string
oldValue?: string
step: OsmObject
}[] = []
for (const history of histories) {
const filtered = history.filter(
(step) =>
!onlyShowUsername ||
onlyShowUsername?.has(step.tags["_last_edit:contributor"])
!onlyShowUsername || onlyShowUsername?.has(step.tags["_last_edit:contributor"])
)
for (const step of filtered) {
const diff: {
key: string;
value?: string;
oldValue?: string;
key: string
value?: string
oldValue?: string
step: OsmObject
}[] = HistoryUtils.tagHistoryDiff(step, history)
allDiffs.push(...diff)
}
}
return allDiffs
}
}