Skip to content

Commit

Permalink
fix: update GeometryPolygon type (#276)
Browse files Browse the repository at this point in the history
  • Loading branch information
Odonno committed Jun 7, 2024
1 parent ff5db0a commit 69f7fe7
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/library/cbor/geometry.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,19 +66,18 @@ export class GeometryLine extends Geometry {
}

export class GeometryPolygon extends Geometry {
readonly polygon: [GeometryLine, GeometryLine, ...GeometryLine[]];
readonly polygon: [GeometryLine, ...GeometryLine[]];

constructor(
polygon:
| [GeometryLine, GeometryLine, ...GeometryLine[]]
| [GeometryLine, ...GeometryLine[]]
| GeometryPolygon,
) {
super();
polygon = polygon instanceof GeometryPolygon
? polygon.polygon
: polygon;
this.polygon = polygon.map((line) => new GeometryLine(line)) as [
GeometryLine,
GeometryLine,
...GeometryLine[],
];
Expand Down

0 comments on commit 69f7fe7

Please sign in to comment.