Skip to content

Commit 38a8e55

Browse files
committed
More type fixes
1 parent e4957b3 commit 38a8e55

File tree

1 file changed

+23
-2
lines changed

1 file changed

+23
-2
lines changed

packages/web/src/app/map/utils.ts

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,21 @@
1-
export function calculateStats(geojson: any) {
1+
interface Stats {
2+
tags: Record<string, number>;
3+
buildings: number;
4+
buildingsAdded: number;
5+
buildingsModified: number;
6+
buildingsDeleted: number;
7+
highways: number;
8+
highwaysAdded: number;
9+
highwaysModified: number;
10+
highwaysDeleted: number;
11+
other: number;
12+
otherAdded: number;
13+
otherModified: number;
14+
otherDeleted: number;
15+
users: Record<string, number>;
16+
}
17+
18+
export function calculateStats(geojson: GeoJSON.FeatureCollection) {
219
const stats = {
320
tags: {},
421
buildings: 0,
@@ -14,9 +31,13 @@ export function calculateStats(geojson: any) {
1431
otherModified: 0,
1532
otherDeleted: 0,
1633
users: {},
17-
};
34+
} as Stats;
1835

1936
for (const feature of geojson.features) {
37+
if (!feature.properties) {
38+
continue;
39+
}
40+
2041
const changeType = feature.properties.changeType;
2142
if (
2243
changeType === "added" ||

0 commit comments

Comments
 (0)