ioredis-mock
Advanced tools
Comparing version 1.6.0 to 1.7.0
@@ -66,3 +66,3 @@ | ||
|[info](http://redis.io/commands/INFO)|:white_check_mark:|:x:| | ||
|[keys](http://redis.io/commands/KEYS)|:white_check_mark:|:x:| | ||
|[keys](http://redis.io/commands/KEYS)|:white_check_mark:|:white_check_mark:| | ||
|[lastsave](http://redis.io/commands/LASTSAVE)|:white_check_mark:|:x:| | ||
@@ -69,0 +69,0 @@ |[latency](http://redis.io/commands/LATENCY)|:white_check_mark:|:x:| |
@@ -8,3 +8,3 @@ 'use strict'; | ||
function append(key, value) { | ||
if (!this.data.hasOwnProperty(key)) { | ||
if (!{}.hasOwnProperty.call(this.data, key)) { | ||
this.data[key] = ''; | ||
@@ -11,0 +11,0 @@ } |
@@ -15,3 +15,3 @@ "use strict"; | ||
return keys.reduce(function (totalExists, key) { | ||
if (_this.data.hasOwnProperty(key)) { | ||
if ({}.hasOwnProperty.call(_this.data, key)) { | ||
return totalExists + 1; | ||
@@ -18,0 +18,0 @@ } |
@@ -8,3 +8,3 @@ "use strict"; | ||
function get(key) { | ||
return this.data.hasOwnProperty(key) ? this.data[key] : null; | ||
return {}.hasOwnProperty.call(this.data, key) ? this.data[key] : null; | ||
} |
@@ -8,5 +8,5 @@ 'use strict'; | ||
function getset(key, val) { | ||
var old = this.data.hasOwnProperty(key) ? this.data[key] : ''; | ||
var old = {}.hasOwnProperty.call(this.data, key) ? this.data[key] : ''; | ||
this.data[key] = val; | ||
return old; | ||
} |
@@ -15,3 +15,3 @@ "use strict"; | ||
return fields.filter(function (field) { | ||
if (_this.data[key].hasOwnProperty(field)) { | ||
if ({}.hasOwnProperty.call(_this.data[key], field)) { | ||
delete _this.data[key][field]; | ||
@@ -18,0 +18,0 @@ return true; |
@@ -8,3 +8,3 @@ 'use strict'; | ||
function hexists(key, field) { | ||
return this.data[key].hasOwnProperty(field) ? '1' : '0'; | ||
return {}.hasOwnProperty.call(this.data[key], field) ? '1' : '0'; | ||
} |
@@ -13,6 +13,6 @@ "use strict"; | ||
if (!this.data.hasOwnProperty(key)) { | ||
if (!{}.hasOwnProperty.call(this.data, key)) { | ||
this.data[key] = _defineProperty({}, field, 0); | ||
} | ||
if (!this.data[key].hasOwnProperty(field)) { | ||
if (!{}.hasOwnProperty.call(this.data[key], field)) { | ||
this.data[key][field] = 0; | ||
@@ -19,0 +19,0 @@ } |
@@ -8,3 +8,3 @@ 'use strict'; | ||
function hmset(key) { | ||
if (!this.data.hasOwnProperty(key)) { | ||
if (!{}.hasOwnProperty.call(this.data, key)) { | ||
this.data[key] = {}; | ||
@@ -11,0 +11,0 @@ } |
@@ -8,7 +8,7 @@ 'use strict'; | ||
function hsetnx(key, hashKey, hashVal) { | ||
if (!this.data.hasOwnProperty(key)) { | ||
if (!{}.hasOwnProperty.call(this.data, key)) { | ||
this.data[key] = {}; | ||
} | ||
if (!this.data[key].hasOwnProperty(hashKey)) { | ||
if (!{}.hasOwnProperty.call(this.data[key], hashKey)) { | ||
this.data[key][hashKey] = hashVal; | ||
@@ -15,0 +15,0 @@ |
@@ -8,3 +8,3 @@ 'use strict'; | ||
function hstrlen(key, field) { | ||
return this.data.hasOwnProperty(key) && this.data[key].hasOwnProperty(field) ? this.data[key][field].length.toString() : '0'; | ||
return {}.hasOwnProperty.call(this.data, key) && {}.hasOwnProperty.call(this.data[key], field) ? this.data[key][field].length.toString() : '0'; | ||
} |
@@ -247,2 +247,14 @@ 'use strict'; | ||
var _keys = require('./keys'); | ||
Object.keys(_keys).forEach(function (key) { | ||
if (key === "default") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _keys[key]; | ||
} | ||
}); | ||
}); | ||
var _rename = require('./rename'); | ||
@@ -249,0 +261,0 @@ |
@@ -10,3 +10,3 @@ "use strict"; | ||
if (!this.data.hasOwnProperty(key)) { | ||
if (!{}.hasOwnProperty.call(this.data, key)) { | ||
this.data[key] = []; | ||
@@ -13,0 +13,0 @@ } |
@@ -8,3 +8,3 @@ 'use strict'; | ||
function setnx(key, val) { | ||
if (!this.data.hasOwnProperty(key)) { | ||
if (!{}.hasOwnProperty.call(this.data, key)) { | ||
this.data[key] = val; | ||
@@ -11,0 +11,0 @@ |
@@ -8,3 +8,3 @@ 'use strict'; | ||
function strlen(key) { | ||
return this.data.hasOwnProperty(key) ? this.data[key].length.toString() : '0'; | ||
return {}.hasOwnProperty.call(this.data, key) ? this.data[key].length.toString() : '0'; | ||
} |
{ | ||
"name": "ioredis-mock", | ||
"version": "1.6.0", | ||
"version": "1.7.0", | ||
"description": "This library emulates ioredis by performing all operations in-memory.", | ||
@@ -38,10 +38,10 @@ "main": "./lib", | ||
"babel-cli": "6.10.1", | ||
"babel-eslint": "6.1.0", | ||
"babel-eslint": "6.1.2", | ||
"babel-preset-es2015": "6.9.0", | ||
"babel-register": "6.9.0", | ||
"babel-register": "6.11.6", | ||
"codeclimate-test-reporter": "0.3.3", | ||
"coveralls": "2.11.9", | ||
"eslint": "3.0.0", | ||
"eslint-config-airbnb-base": "3.0.1", | ||
"eslint-plugin-import": "1.10.1", | ||
"coveralls": "2.11.12", | ||
"eslint": "3.2.2", | ||
"eslint-config-airbnb-base": "5.0.1", | ||
"eslint-plugin-import": "1.12.0", | ||
"expect": "1.20.2", | ||
@@ -52,10 +52,11 @@ "growl": "1.9.2", | ||
"mkdirp": "0.5.1", | ||
"mocha": "2.5.3", | ||
"rimraf": "2.5.3" | ||
"mocha": "3.0.0", | ||
"rimraf": "2.5.4" | ||
}, | ||
"dependencies": { | ||
"bluebird": "3.4.1", | ||
"lodash": "4.13.1", | ||
"lodash": "4.14.1", | ||
"minimatch": "^3.0.2", | ||
"redis-commands": "1.2.0" | ||
} | ||
} |
@@ -7,4 +7,5 @@ require('babel-register'); | ||
const RedisMock = require('../src').default; | ||
const mockedRedis = new RedisMock; | ||
const mockedRedis = new RedisMock(); | ||
let tableMd = ` | ||
@@ -11,0 +12,0 @@ ### Supported commands |
Sorry, the diff of this file is not supported yet
40875
46
729
5
+ Addedminimatch@^3.0.2
+ Addedbalanced-match@1.0.2(transitive)
+ Addedbrace-expansion@1.1.11(transitive)
+ Addedconcat-map@0.0.1(transitive)
+ Addedlodash@4.14.1(transitive)
+ Addedminimatch@3.1.2(transitive)
- Removedlodash@4.13.1(transitive)
Updatedlodash@4.14.1