We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 4a06840 commit 591df7bCopy full SHA for 591df7b
src/library/cbor/geometry.ts
@@ -34,9 +34,13 @@ export class GeometryPoint extends Geometry {
34
}
35
36
export class GeometryLine extends Geometry {
37
- readonly line: [GeometryPoint, GeometryPoint];
+ readonly line: [GeometryPoint, GeometryPoint, ...GeometryPoint[]];
38
39
- constructor(line: [GeometryPoint, GeometryPoint] | GeometryLine) {
+ // SurrealDB only has the context of a "Line", which is two points.
40
+ // SurrealDB's "Line" is actually a "LineString" under the hood, which accepts two or more points
41
+ constructor(
42
+ line: [GeometryPoint, GeometryPoint, ...GeometryPoint[]] | GeometryLine,
43
+ ) {
44
super();
45
line = line instanceof GeometryLine ? line.line : line;
46
this.line = [new GeometryPoint(line[0]), new GeometryPoint(line[1])];
0 commit comments