Skip to content

Commit

Permalink
fix: Deprecated Redis() in favor of new Redis()
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed Jun 30, 2018
1 parent 8a87b95 commit 8e7c6f1
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ var PromiseContainer = require('./promise_container');
* ```
*/
function Redis() {
if (!(this instanceof Redis)) {
console.error(new Error('Calling `Redis()` like a function is deprecated. Using `new Redis()` instead.').stack.replace('Error', 'Warning'));
return new Redis(arguments[0], arguments[1], arguments[2]);
}

this.parseOptions(arguments[0], arguments[1], arguments[2]);

EventEmitter.call(this);
Expand Down

0 comments on commit 8e7c6f1

Please sign in to comment.