MotionScript

@motion-script/core


@motion-script/core / toPathCommands

Function: toPathCommands()

toPathCommands(d): PathCommand[]

Defined in: attributes/shape/path/parse.ts:88

Coerce loose PathData into a PathCommand array, parsing strings. Nullish input yields an empty command list rather than throwing downstream — a Path whose d hasn't been set yet (or was cleared) is a valid empty shape, and morphing/measuring it should degrade gracefully.

Parameters

d

PathData | null | undefined

Returns

PathCommand[]