---
name: to_pascal_case
kind: function
lang: py
domain: core
version: "1.0.0"
purity: pure
signature: "def to_pascal_case(name: str) -> str"
description: "Convierte cualquier formato de nombre (snake_case, camelCase, kebab-case, mixto) a PascalCase. Retorna \"Unknown\" para entrada vacia."
tags: [string, naming, pascal-case, case-conversion, formatting, python]
uses_functions: []
uses_types: []
returns: []
returns_optional: false
error_type: ""
imports: [re]
params:
  - name: name
    desc: "String en cualquier formato de naming (snake_case, camelCase, kebab-case, etc.)"
output: "String convertido a PascalCase, o 'Unknown' si está vacío"
tested: true
tests:
  - "snake_case"
  - "camelCase"
  - "UPPER_SNAKE"
  - "kebab-case"
  - "pascal_case_idempotente"
  - "string_vacio"
  - "con_numeros"
test_file_path: "python/functions/core/to_pascal_case_test.py"
file_path: "python/functions/core/to_pascal_case.py"
---

## Ejemplo

```python
to_pascal_case("works_for")        # "WorksFor"
to_pascal_case("camelCaseExample") # "CamelCaseExample"
to_pascal_case("SCREAMING_SNAKE")  # "ScreamingSnake"
to_pascal_case("kebab-case")       # "KebabCase"
to_pascal_case("")                 # "Unknown"
```

## Notas

Funcion pura, sin dependencias externas (solo `re` de stdlib).

Algoritmo en dos pasos:
1. Split por caracteres no alfanumericos: `re.split(r'[^a-zA-Z0-9]+', name)`
2. Split adicional por boundary camelCase en cada parte: `re.sub(r'([a-z])([A-Z])', r'\1_\2', part).split('_')`

Cada word resultante se capitaliza (primera letra upper, resto lower) y se concatenan. Si no hay words validas, retorna `"Unknown"`.
