This way APIs could accept an interface of { points: Point[] } and be made to work with both Polygon-type shapes and Line-type shapes easily.
This would also allow for destructuring line.points to quickly renaming variables, for example:
// could be...
let [a, b] = line.points
// instead of...
let a = line.p1
let b = line.p2
(I'm just opening issues as I use the library and run into problems or inconveniences, but let me know if you'd prefer I not open these kind of ideas issues.)
This way APIs could accept an interface of
{ points: Point[] }and be made to work with bothPolygon-type shapes andLine-type shapes easily.This would also allow for destructuring
line.pointsto quickly renaming variables, for example:(I'm just opening issues as I use the library and run into problems or inconveniences, but let me know if you'd prefer I not open these kind of ideas issues.)