function normalizePath(pathInput) {
  if (isNormalizedArray(pathInput)) {
    return clonePath(pathInput);
  }

  /** @type {SVGPath.normalArray} */
  const path = pathToAbsolute(pathInput);
  const params = { ...paramsParser };
  const ii = path.length;

  for (let i = 0; i < ii; i += 1) {
    path[i];
    path[i] = normalizeSegment(path[i], params);

    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;
}
Normalizes a `path` object for further processing:
* convert segments to absolute values
* convert shorthand path commands to their non-shorthand notation

@param {string | SVGPath.pathArray} pathInput the string to be parsed or 'pathArray'
@returns {SVGPath.normalArray} the normalized `pathArray`