Skip to content

Commit

Permalink
fix: resolve warning for Buffer() in Node.js 10
Browse files Browse the repository at this point in the history
  • Loading branch information
luin committed Jul 22, 2018
1 parent a28983d commit 6144c56
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/redis.js
Original file line number Diff line number Diff line change
Expand Up @@ -597,7 +597,7 @@ Redis.prototype.sendCommand = function (command, stream) {

if (!writable && command.name === 'quit' && this.offlineQueue.length === 0) {
this.disconnect();
command.resolve(new Buffer('OK'));
command.resolve(Buffer.from('OK'));
return command.promise;
}

Expand Down
2 changes: 1 addition & 1 deletion lib/redis/parser.js
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ exports.returnError = function (err) {

var sharedBuffers = {};
_.forEach(['message', 'pmessage', 'subscribe', 'psubscribe', 'unsubscribe', 'punsubscribe'], function (str) {
sharedBuffers[str] = new Buffer(str);
sharedBuffers[str] = Buffer.from(str);
});
exports.returnReply = function (reply) {
if (this.status === 'monitoring') {
Expand Down
2 changes: 1 addition & 1 deletion lib/utils/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ exports.bufferEqual = function (a, b) {
* @return {*} The result
* @example
* ```js
* var input = [new Buffer('foo'), [new Buffer('bar')]];
* var input = [Buffer.from('foo'), [Buffer.from('bar')]];
* var res = convertBufferToString(input, 'utf8');
* expect(res).to.eql(['foo', ['bar']]);
* ```
Expand Down

0 comments on commit 6144c56

Please sign in to comment.