Skip to content

Commit

Permalink
Correctly asses arguments to promisify, fixing #173
Browse files Browse the repository at this point in the history
  • Loading branch information
saschat committed Jan 11, 2024
1 parent f10b260 commit 6854a55
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/memjs/memjs.js
Original file line number Diff line number Diff line change
Expand Up @@ -259,7 +259,7 @@ Client.prototype.set = function(key, value, options, callback) {
//
// callback(err, success)
Client.prototype.add = function(key, value, options, callback) {
if(callback === undefined && options !== 'function') {
if(callback === undefined && typeof options !== 'function') {
var self = this;
if (!options) options = {};
return promisify(function(callback) { self.add(key, value, options, function(err, success) { callback(err, success); }); });
Expand Down Expand Up @@ -318,7 +318,7 @@ Client.prototype.add = function(key, value, options, callback) {
//
// callback(err, success)
Client.prototype.replace = function(key, value, options, callback) {
if(callback === undefined && options !== 'function') {
if(callback === undefined && typeof options !== 'function') {
var self = this;
if (!options) options = {};
return promisify(function(callback) { self.replace(key, value, options, function(err, success) { callback(err, success); }); });
Expand Down Expand Up @@ -414,7 +414,7 @@ Client.prototype.delete = function(key, callback) {
//
// callback(err, success, value)
Client.prototype.increment = function(key, amount, options, callback) {
if(callback === undefined && options !== 'function') {
if(callback === undefined && typeof options !== 'function') {
var self = this;
return promisify(function(callback) {
if (!options) options = {};
Expand Down Expand Up @@ -476,7 +476,7 @@ Client.prototype.increment = function(key, amount, options, callback) {
//
// callback(err, success, value)
Client.prototype.decrement = function(key, amount, options, callback) {
if(callback === undefined && options !== 'function') {
if(callback === undefined && typeof options !== 'function') {
var self = this;
return promisify(function(callback) {
self.decrement(key, amount, options, function(err, success, value) {
Expand Down

0 comments on commit 6854a55

Please sign in to comment.