The GeometryEngine in runtime 100.1 onwards has a cut method that cuts a geometry using a polyline.
However, what would be the best and safest way to split an actual polyline by a single point?
Currently, I would need to create a polyline as the cutter. Since all I have is a single point, then technically, without knowing ahead of time the geometry of the polyline I want to cut, I would have to add another random point to my known point to create a polyline, then use that as the cutter to cut my initial polyline. No matter where I add that second random point, I could never be sure that it wouldn't intersect the initial polyline twice.
The only safe way is the way I previously did it, where I create a brand new polyline and add all the points up to that cut/split point and use that new polyline.
Is there a better way I'm missing? Or is this perhaps a suggestion for a variation of the cut method specifically for this task?