coinpaprika / coinpaprika-api-nodejs-client

This library provides convenient way to use Coinpaprika.com API in NodeJS.
https://api.coinpaprika.com/
MIT License
46 stars 12 forks source link

Added method to retrieve Coins OHLCV Historical #4

Closed lucasfabre closed 4 years ago

lucasfabre commented 4 years ago

Hello,

I was using the package for a school project and I needed the Coins OHLCV Historical. Thanks you for the free coinpaprika API.

marcin-jarota commented 4 years ago

Hi, it looks good beyond a small detail. typeof [] will return the same output as typeof {} because of in JavaScript arrays are technically objects with special behaviours and abilities. Please solve that issue using comparison like this: Object.prototype.toString.call(obj) === '[object Object]' or duck typing and write more test cases.

lucasfabre commented 4 years ago

Hi, sorry for the late fix, I fixed the problem and added an associated test case.

marcin-jarota commented 4 years ago

Hi, thanks for fix that but I've noticed one more thing which may be improve. In case when you have to check if error has been thrown it is better to use dedicated method .toThrowError rather than throw new error and compare two strings https://jestjs.io/docs/en/expect#tothrowerror

lucasfabre commented 4 years ago

Is it better now ?