Closed hassellof closed 8 years ago
looks good to me
@hassellof could you, please, add tests for
@dimchez I was planning to take a look at your tests and to expand the test coverage a bit tomorrow. Just quickly getting acquainted with the code today.
Regarding typeof, it's just good practice when checking if a value is defined or not since there are many values that returns false in an if statement, like 0.
Double exclamation marks should always be avoided though, since it makes the code much more difficult to understand at a first glance. Just like double negation in spoken language makes things more difficult, especially for non-native speakers.
In this context it really makes no practical difference, typeof just makes it more readable imho. If you want an shorter alternative to "typeof undefined" then just if(config.root) should work well, since 0 et.al. is not a valid value for root URL any way.
@hassellof ok, typeof it is then :+1:
oh, forgotten pr
Support for setting root url before calling API using setConfig({root: 'http://something'})
Fixed spelling in README and included instructions for how to use setConfig