From adaff94dbdf23a75f9575356cee832e181a725df Mon Sep 17 00:00:00 2001 From: Pieter Vander Vennet Date: Mon, 26 Feb 2024 15:44:15 +0100 Subject: [PATCH] Improve typing --- src/Logic/BBox.ts | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/Logic/BBox.ts b/src/Logic/BBox.ts index e69499c7a..fd5ef5e5b 100644 --- a/src/Logic/BBox.ts +++ b/src/Logic/BBox.ts @@ -45,15 +45,16 @@ export class BBox { ]) } - static get(feature): BBox { - if (feature.bbox?.overlapsWith === undefined) { + static get(feature: Feature): BBox { + const f = feature + if (f.bbox?.overlapsWith === undefined) { const turfBbox: number[] = turf.bbox(feature) - feature.bbox = new BBox([ + f["bbox"] = new BBox([ [turfBbox[0], turfBbox[1]], [turfBbox[2], turfBbox[3]], ]) } - return feature.bbox + return f["bbox"] } static bboxAroundAll(bboxes: BBox[]): BBox {