From 3d2535180d638f6178780541f4a65b3760e6c70a Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Mon, 3 May 2021 18:52:57 +0000 Subject: [PATCH 1/2] fix broken tests --- src/rest/run_method.ts | 7 ++++++- tests/util/loop_object.ts | 7 ++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/src/rest/run_method.ts b/src/rest/run_method.ts index e39680aab..53ff1f34b 100644 --- a/src/rest/run_method.ts +++ b/src/rest/run_method.ts @@ -14,7 +14,12 @@ export async function runMethod( if (body) { body = loopObject( body as Record, - (value) => typeof value === "bigint" ? value.toString() : value, + (value) => + typeof value === "bigint" + ? value.toString() + : Array.isArray(value) + ? value.map((v) => typeof v === "bigint" ? v.toString() : v) + : value, `Running forEach loop in runMethod function for changing bigints to strings.`, ); } diff --git a/tests/util/loop_object.ts b/tests/util/loop_object.ts index 236f4738f..bc5c11d17 100644 --- a/tests/util/loop_object.ts +++ b/tests/util/loop_object.ts @@ -40,7 +40,12 @@ Deno.test({ fn() { const converted = loopObject( objWithBigints, - (value) => typeof value === "bigint" ? value.toString() : value, + (value) => + typeof value === "bigint" + ? value.toString() + : Array.isArray(value) + ? value.map((v) => typeof v === "bigint" ? v.toString() : v) + : value, `Running for loop in unit test function for changing bigints to strings.`, ); From 9f2729711250ee7b09fe57d2ed252ba541f3a9b7 Mon Sep 17 00:00:00 2001 From: Skillz4Killz <23035000+Skillz4Killz@users.noreply.github.com> Date: Mon, 3 May 2021 18:53:10 +0000 Subject: [PATCH 2/2] deno fmt --- src/util/mod.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util/mod.ts b/src/util/mod.ts index fe2efd7b1..9af7e2b53 100644 --- a/src/util/mod.ts +++ b/src/util/mod.ts @@ -4,4 +4,4 @@ export * from "./constants.ts"; export * from "./loop_object.ts"; export * from "./permissions.ts"; export * from "./utils.ts"; -export * from "./validate_length.ts"; \ No newline at end of file +export * from "./validate_length.ts";