Commit 16c51c93 by Ben Drucker

Expect query to be an empty options instead of undefined

parent 9e3fbd4e
...@@ -38,12 +38,13 @@ ClearbitClient.prototype.url = function (options) { ...@@ -38,12 +38,13 @@ ClearbitClient.prototype.url = function (options) {
ClearbitClient.prototype.request = function (options) { ClearbitClient.prototype.request = function (options) {
options = _.defaults(options || {}, { options = _.defaults(options || {}, {
method: 'get' method: 'get',
query: {}
}); });
return needle.requestAsync( return needle.requestAsync(
options.method, options.method,
this.url(options), this.url(options),
options.query, !_.isEmpty(options.query) ? options.query : void 0,
{ {
username: this.key, username: this.key,
user_agent: 'ClearbitNode/v' + pkg.version user_agent: 'ClearbitNode/v' + pkg.version
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment