From ea85ee0dc75be3dd0ab145ac62053137b7204f3c Mon Sep 17 00:00:00 2001
From: Marin Karamihalev <marin.karamihalev@iopsys.eu>
Date: Mon, 9 Jan 2023 15:28:08 +0100
Subject: [PATCH] simplified version files

---
 src/commands/index.ts | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/src/commands/index.ts b/src/commands/index.ts
index 2310129..100b8b5 100644
--- a/src/commands/index.ts
+++ b/src/commands/index.ts
@@ -32,7 +32,10 @@ const getCommand = (
   version: USPVersion,
   commandType: CommandType
 ): CommandObject | null =>
-  versionSpecificCommands[version][commandType] || common[commandType] || null;
+  version in versionSpecificCommands &&
+  commandType in versionSpecificCommands[version]
+    ? versionSpecificCommands[version][commandType]
+    : common[commandType] || null;
 
 const recipes: RecipeObject[] = [resolve as any, operateRecipe, subscribe];
 
-- 
GitLab