1
0
mirror of https://github.com/redis/node-redis.git synced 2025-08-07 13:22:56 +03:00

Add string_numbers option to handle very big numbers

This commit is contained in:
Ruben Bridgewater
2016-03-27 03:06:32 +02:00
parent 2e68a7a270
commit 0c5947be51
8 changed files with 62 additions and 89 deletions

View File

@@ -59,9 +59,13 @@ module.exports = {
};
},
isString: function (str, done) {
str = '' + str; // Make sure it's a string
return function (err, results) {
assert.strictEqual(null, err, "expected string '" + str + "', got error: " + err);
assert.equal(str, results, str + ' does not match ' + results);
if (Buffer.isBuffer(results)) { // If options are passed to return either strings or buffers...
results = results.toString();
}
assert.strictEqual(str, results, str + ' does not match ' + results);
if (done) done();
};
},