From df6fe07994b98d61c2b0edc84f0f4056f5bae5f0 Mon Sep 17 00:00:00 2001 From: deimantas Jakovlevas Date: Sat, 29 Jan 2022 18:08:35 +0000 Subject: [PATCH] fix: assign timestep to lowercase if provided. --- src/api-wrapper.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/api-wrapper.ts b/src/api-wrapper.ts index abd8c71..30b3ad8 100644 --- a/src/api-wrapper.ts +++ b/src/api-wrapper.ts @@ -83,7 +83,7 @@ export const prices = async (options: { const { timestamp, useragent } = options || {}; let { timestep } = options || {}; if (!useragent) throw new Error("useragent is required"); - if (timestep) timestep.toLowerCase(); + if (timestep) timestep = timestep.toLowerCase() as "5m" | "1h"; if (timestep !== "5m" && timestep !== "1h") console.error("interval must be '5m' or '1h'. Falling back to 5min, in future, this will be an error.");