function collectRenamedProps(pattern) {
  const renamedProps = new Set()

  if (!pattern || pattern.type !== 'ObjectPattern') {
    return renamedProps
  }

  for (const prop of pattern.properties) {
    if (prop.type !== 'Property') continue

    if (
      prop.key.type === 'Identifier' &&
      prop.value.type === 'Identifier' &&
      prop.key.name !== prop.value.name
    ) {
      renamedProps.add(prop.key.name)
    }
  }

  return renamedProps
}
Collects all renamed props from a pattern
@param {Pattern | null} pattern - The destructuring pattern
@returns {Set<string>} - Set of prop names that have been renamed