function getMaxPathLengthFromPropertyChanges()

in src/helpers/whatif.ts [618:631]


function getMaxPathLengthFromPropertyChanges(
  propertyChanges: WhatIfPropertyChange[],
): number {
  if (!propertyChanges || propertyChanges.length === 0) {
    return 0;
  }

  const filteredPropertyChanges = propertyChanges.filter(
    shouldConsiderPropertyChangePath,
  );
  const pathLengths = filteredPropertyChanges.map(x => x.path.length);

  return Math.max(...pathLengths, 0);
}