Skip to content

Commit

Permalink
fix(undefined options passed to .get): set default options valu…
Browse files Browse the repository at this point in the history
…e to `{}` (#115)

This fixes stream calls without an `options` argument.  E.g.,:

```
// This used to TypeError.
// Now it returns a stream.
const stream = core.ns.po.get();
```

#37 (comment)
  • Loading branch information
silasbw committed Jun 18, 2017
1 parent 08ba55f commit b2df448
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions lib/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,8 @@ class BaseObject extends CallableObject {
options = {};
} else if (typeof options === 'string') {
options = { name: options };
} else if (typeof options === 'undefined') {
options = {};
}
const qs = Object.assign({}, this.qs, options.qs || {});

Expand Down

0 comments on commit b2df448

Please sign in to comment.