getLength()
Part of the @remotion/paths package.
Gets the length of an SVG path. The length must
A number is returned if the path is valid:
tsximport {getLength } from "@remotion/paths";constlength =getLength ("M 0 0 L 100 0");console .log (length ); // 100
tsximport {getLength } from "@remotion/paths";constlength =getLength ("M 0 0 L 100 0");console .log (length ); // 100
The function will throw if the path is invalid:
tsxgetLength ("remotion"); // Error: Malformed path data: ...
tsxgetLength ("remotion"); // Error: Malformed path data: ...
Credits
Source code stems mostly from svg-path-properties.