Skip to content

Commit

Permalink
fix: assign timestep to lowercase if provided.
Browse files Browse the repository at this point in the history
  • Loading branch information
deimantas Jakovlevas committed Jan 29, 2022
1 parent 2e33c2f commit df6fe07
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/api-wrapper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.");
Expand Down

0 comments on commit df6fe07

Please sign in to comment.