Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

then-redis

Package Overview
Dependencies
Maintainers
1
Versions
29
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

then-redis - npm Package Compare versions

Comparing version 1.2.1 to 1.2.2

dump.rdb

112

modules/Client.js
var url = require('url');
var redis = require('redis');
var d = require('describe-property');
var EventEmitter = require('events').EventEmitter;

@@ -130,65 +131,52 @@ var appendHashToArray = require('./utils/appendHashToArray');

// Parse the result of INFO.
info: {
value: function () {
return this.send('info').then(parseInfo);
}
},
info: d(function () {
return this.send('info').then(parseInfo);
}),
// Optionally accept an array as the only argument to MGET.
mget: {
value: function (keys) {
var args = Array.isArray(keys) ? keys : slice.call(arguments, 0);
return this.send('mget', args);
}
},
mget: d(function (keys) {
var args = Array.isArray(keys) ? keys : slice.call(arguments, 0);
return this.send('mget', args);
}),
// Optionally accept a hash as the only argument to MSET.
mset: {
value: function (hash) {
var args = (typeof hash === 'object') ? appendHashToArray(hash, []) : slice.call(arguments, 0);
return this.send('mset', args);
}
},
mset: d(function (hash) {
var args = (typeof hash === 'object') ? appendHashToArray(hash, []) : slice.call(arguments, 0);
return this.send('mset', args);
}),
// Optionally accept a hash as the only argument to MSETNX.
msetnx: {
value: function (hash) {
var args = (typeof hash === 'object') ? appendHashToArray(hash, []) : slice.call(arguments, 0);
return this.send('msetnx', args);
}
},
msetnx: d(function (hash) {
var args = (typeof hash === 'object') ? appendHashToArray(hash, []) : slice.call(arguments, 0);
return this.send('msetnx', args);
}),
// Optionally accept a hash as the first argument to HMSET after the key.
hmset: {
value: function (key, hash) {
var args = (typeof hash === 'object') ? appendHashToArray(hash, [ key ]) : slice.call(arguments, 0);
return this.send('hmset', args);
}
},
hmset: d(function (key, hash) {
var args = (typeof hash === 'object') ? appendHashToArray(hash, [ key ]) : slice.call(arguments, 0);
return this.send('hmset', args);
}),
// Update the selected_db property of the client on SELECT.
select: {
value: function (db) {
var client = this._redisClient;
select: d(function (db) {
var client = this._redisClient;
return new Promise(function (resolve, reject) {
// Need to use this so selected_db updates properly.
client.select(db, function (error, value) {
if (error) {
reject(error);
} else {
resolve(value);
}
});
return new Promise(function (resolve, reject) {
// Need to use this so selected_db updates properly.
client.select(db, function (error, value) {
if (error) {
reject(error);
} else {
resolve(value);
}
});
}
},
});
}),
// Optionally accept an array as the only argument to DEL.
del: {
value: function (keys) {
var args = Array.isArray(keys) ? keys : slice.call(arguments, 0);
return this.send('del', args);
}
}
del: d(function (keys) {
var args = Array.isArray(keys) ? keys : slice.call(arguments, 0);
return this.send('del', args);
})
});

@@ -198,16 +186,12 @@

[ 'lpush', 'rpush' ].forEach(function (command) {
Object.defineProperty(Client.prototype, command, {
value: function (key, array) {
var args = Array.isArray(array) ? [ key ].concat(array) : slice.call(arguments, 0);
return this.send(command, args);
}
});
Object.defineProperty(Client.prototype, command, d(function (key, array) {
var args = Array.isArray(array) ? [ key ].concat(array) : slice.call(arguments, 0);
return this.send(command, args);
}));
});
PROPERTIES.forEach(function (propertyName) {
Object.defineProperty(Client.prototype, propertyName, {
get: function () {
return this._redisClient[propertyName];
}
});
Object.defineProperty(Client.prototype, propertyName, d.gs(function () {
return this._redisClient[propertyName];
}));
});

@@ -222,9 +206,7 @@

Object.defineProperty(Client.prototype, command, {
value: function () {
return this.send(command, slice.call(arguments, 0));
}
});
Object.defineProperty(Client.prototype, command, d(function () {
return this.send(command, slice.call(arguments, 0));
}));
});
module.exports = Client;
{
"name": "then-redis",
"version": "1.2.1",
"version": "1.2.2",
"description": "A small, promise-based Redis client",

@@ -14,3 +14,4 @@ "main": "modules/index.js",

"dependencies": {
"bluebird": "^2.3.11"
"bluebird": "^2.3.11",
"describe-property": "^1.0.0"
},

@@ -17,0 +18,0 @@ "devDependencies": {

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc