From 852f9491814bcb9450b5b2291572692e0155be10 Mon Sep 17 00:00:00 2001
From: Marin Karamihalev <marin.karamihalev@iopsys.eu>
Date: Fri, 21 Jan 2022 14:34:56 +0100
Subject: [PATCH] removed undefined filter in get return

---
 src/commands/util.ts            | 2 +-
 tests/integration/index.test.ts | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/commands/util.ts b/src/commands/util.ts
index 5f5f7d1..db44763 100644
--- a/src/commands/util.ts
+++ b/src/commands/util.ts
@@ -141,7 +141,7 @@ export const fullyUnwrapObject = (obj: any, shouldBeArray: boolean) => {
     return fullyUnwrapObject(Object.values(obj)[0], shouldBeArray);
   const isArray = Array.isArray(obj);
   if (shouldBeArray)
-    if (isArray) return obj.filter((it) => it !== null && it !== null);
+    if (isArray) return obj;
     else return [obj];
   else if (isArray)
     return fullyUnwrapObject(
diff --git a/tests/integration/index.test.ts b/tests/integration/index.test.ts
index a89d140..3df8d44 100644
--- a/tests/integration/index.test.ts
+++ b/tests/integration/index.test.ts
@@ -220,7 +220,7 @@ describe("Test general API", () => {
       .get("Device.DeviceInfo.SerialNumber");
   });
 
-  it.only("downloaddiagnostic() executes without error", async () => {
+  it("downloaddiagnostic() executes without error", async () => {
     const [op, clearOp] = await device.operate(
       "Device.IP.Diagnostics.DownloadDiagnostics()"
     );
-- 
GitLab