function pathToCurve(pathInput) {
  /* istanbul ignore else */
  if (isCurveArray(pathInput)) {
    // `isCurveArray` checks if it's `pathArray`
    return clonePath(pathInput);
  }

  // const path = fixPath(normalizePath(pathInput));
  const path = normalizePath(pathInput);
  const params = { ...paramsParser };
  const allPathCommands = [];
  let pathCommand = ''; // ts-lint
  let ii = path.length;

  for (let i = 0; i < ii; i += 1) {
    [pathCommand] = path[i];
    allPathCommands[i] = pathCommand;

    path[i] = segmentToCubic(path[i], params);

    fixArc(path, allPathCommands, i);
    ii = path.length;

    const segment = path[i];
    const seglen = segment.length;
    params.x1 = +segment[seglen - 2];
    params.y1 = +segment[seglen - 1];
    params.x2 = +(segment[seglen - 4]) || params.x1;
    params.y2 = +(segment[seglen - 3]) || params.y1;
  }

  return path;
}
Parses a path string value or 'pathArray' and returns a new one
in which all segments are converted to cubic-bezier.

In addition, un-necessary `Z` segment is removed if previous segment
extends to the `M` segment.

@param {string | SVGPath.pathArray} pathInput the string to be parsed or 'pathArray'
@returns {SVGPath.curveArray} the resulted `pathArray` converted to cubic-bezier