mirror of
https://github.com/Abdulazizzn/n8n-enterprise-unlocked.git
synced 2025-12-18 10:31:15 +00:00
feat(core): Improve nodeNameToToolName special characters normalization (#15126)
This commit is contained in:
@@ -251,6 +251,10 @@ export function unwrapNestedOutput(output: Record<string, unknown>): Record<stri
|
||||
return output;
|
||||
}
|
||||
|
||||
/**
|
||||
* Converts a node name to a valid tool name by replacing special characters with underscores
|
||||
* and collapsing consecutive underscores into a single one.
|
||||
*/
|
||||
export function nodeNameToToolName(node: INode): string {
|
||||
return node.name.replace(/ /g, '_');
|
||||
return node.name.replace(/[\s.?!=+#@&*()[\]{}:;,<>\/\\'"^%$]/g, '_').replace(/_+/g, '_');
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user