From c819bbb8e4e8d7218ece9a3799fd21dbe640892a Mon Sep 17 00:00:00 2001 From: Kostas Minaidis Date: Sat, 27 Jul 2024 01:52:46 +0200 Subject: [PATCH] Remove unnecessary else/if statements Make the code example cleaner and easier to read by removing unnecessary else/if statements. --- .../expression_language/how_to_routing_custom_function.ts | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/examples/src/guides/expression_language/how_to_routing_custom_function.ts b/examples/src/guides/expression_language/how_to_routing_custom_function.ts index cb1d4de80fcb..235ff0380a09 100644 --- a/examples/src/guides/expression_language/how_to_routing_custom_function.ts +++ b/examples/src/guides/expression_language/how_to_routing_custom_function.ts @@ -61,11 +61,11 @@ Answer:` const route = ({ topic }: { input: string; topic: string }) => { if (topic.toLowerCase().includes("anthropic")) { return anthropicChain; - } else if (topic.toLowerCase().includes("langchain")) { + } + if (topic.toLowerCase().includes("langchain")) { return langChainChain; - } else { - return generalChain; - } + } + return generalChain; }; const fullChain = RunnableSequence.from([