xaviergonz / js-angusj-clipper

Polygon and line clipping and offsetting library (Javascript) - a port of Angus Johnson's clipper

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

clipToPaths and clipToPolyTree have incorret undefined union return value?

cmidgley opened this issue · comments

commented

In ClipperLibWrapper I see that clipToPaths and clipToPolyTree both have return values that are the native type, plus a union for undefined:

clipToPaths(params: ClipParams): Paths | undefined { ... }
clipToPolyTree(params: ClipParams): PolyTree | undefined { ... }

However, in looking at the implementation, I see that the lower level functions (in functions.ts) do not return undefined, and appear to throw exceptions on errors. I did not look deeper to verify if this was a perhaps type error on those functions (in functions) but seeing as the other methods in ClipperLibWrapper do not return undefined I'm wondering if the undefined can be removed from ClipperLibWrapper?

clipToPaths(params: ClipParams): Paths { ... }
clipToPolyTree(params: ClipParams): PolyTree { ... }

Edit: I noticed there are other methods as well that define a union return type with undefined, but not all of them.

Thanks! you were right. fixed in v1.3.1