Skip to content

Commit

Permalink
Fix PR #280
Browse files Browse the repository at this point in the history
  • Loading branch information
watson committed Jan 14, 2016
1 parent 0474215 commit 8751669
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions lib/collection.js
Original file line number Diff line number Diff line change
Expand Up @@ -142,8 +142,8 @@ Collection.prototype.remove = function (query, opts, cb) {
}

Collection.prototype.rename = function (name, opts, cb) {
if (typeof opts === 'undefined') return this.rename(name, {}, noop)
if (typeof cb === 'undefined') return this.rename(name, noop)
if (!opts) return this.rename(name, {}, noop)
if (!cb) return this.rename(name, noop)

this._getCollection(function (err, collection) {
if (err) return cb(err)
Expand Down

2 comments on commit 8751669

@saintedlama
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 Changed the other occurrences of typeof XYZ === 'undefined' to pattern !XYZ

@watson
Copy link
Collaborator Author

@watson watson commented on 8751669 Jan 15, 2016

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@saintedlama The few places I looked before commenting on the PR used !foo already - this is what prompted me to make the comment. I didn't see any place that used typeof XYZ === 'undefined', but didn't look that hard 😃

Please sign in to comment.