Is there a way to validate the path string used in the Geometry class to make sure it’s a valid string including the specific GoJS tokens like F e.g.(F M 50, 50 M 0 -00 A 20 20 0 1 0 1 0 Z)?
GoJS code crashes when it tries to parse and render an invalid path and I want to make sure is valid before being used.
I’m not sure if there’s an easy way. But GoJS itself does not contain or use an SVG-path validator. If you don’t think your path is necessarily valid, you could use a try / catch block, but that’s a little lazy.
If you want to be more formal about it, you could use any number of SVG path validators first, though such validators would not accept all SVG that GoJS will accept, since we accept other commands too (such as B arcs).