(name: string)
| 44 | * during the transition. |
| 45 | */ |
| 46 | export function normalizeNameForMCP(name: string): string { |
| 47 | const compatibilityNames = getManagedConnectorCompatibilityNames(name) |
| 48 | const normalizationInput = |
| 49 | compatibilityNames.length > 1 ? compatibilityNames[1] : name |
| 50 | |
| 51 | let normalized = normalizationInput.replace(/[^a-zA-Z0-9_-]/g, '_') |
| 52 | if (compatibilityNames.length > 1) { |
| 53 | normalized = normalized.replace(/_+/g, '_').replace(/^_|_$/g, '') |
| 54 | } |
| 55 | return normalized |
| 56 | } |
no test coverage detected