ioredis-mock
Advanced tools
Comparing version 3.8.3 to 3.9.0
409
CHANGELOG.md
@@ -11,2 +11,27 @@ # Changelog | ||
## [3.9.0] - 2018-06-04 | ||
## Added | ||
- `zrevrangebyscore` commands (#442 @kylewm) | ||
- `zrem` and `zincrby` commands (#443 @kylewm) | ||
## [3.8.3] - 2018-05-25 | ||
## Fixed | ||
- missing case in `spop` (#433 @BastienAr) | ||
## [3.8.2] - 2018-05-24 | ||
## Fixed | ||
- `spop` behaviour (#432 @BastienAr) | ||
## [3.8.1] - 2018-04-12 | ||
## Fixed | ||
- flatten (smoosh) args correctly (#405 @BastienAr) | ||
## [3.8.0] - 2018-04-10 | ||
@@ -16,3 +41,3 @@ | ||
* `zscanStream` and `hscanStream` commands (#393 @BastienAr) | ||
- `zscanStream` and `hscanStream` commands (#393 @BastienAr) | ||
@@ -23,3 +48,3 @@ ## [3.7.1] - 2018-04-03 | ||
* `pexpire, pexpireat, psetex` to set correct expire time (#389 @vaskevich) | ||
- `pexpire, pexpireat, psetex` to set correct expire time (#389 @vaskevich) | ||
@@ -30,3 +55,3 @@ ## [3.7.0] - 2018-04-01 | ||
* `scanStream` command (#363 @BastienAr) | ||
- `scanStream` command (#363 @BastienAr) | ||
@@ -37,3 +62,3 @@ ## [3.6.4] - 2018-02-17 | ||
* `keys` no longer returns empty sets, just like real redis (#358) | ||
- `keys` no longer returns empty sets, just like real redis (#358) | ||
@@ -44,3 +69,3 @@ ## [3.6.3] - 2018-02-06 | ||
* `srandom` not using `Set`. (#356 @ianmuninio) | ||
- `srandom` not using `Set`. (#356 @ianmuninio) | ||
@@ -51,3 +76,3 @@ ## [3.6.2] - 2018-02-01 | ||
* `del` should return number of keys deleted from the data, not the number of arguments (#355 @donaldjarmstrong) | ||
- `del` should return number of keys deleted from the data, not the number of arguments (#355 @donaldjarmstrong) | ||
@@ -58,3 +83,3 @@ ## [3.6.1] - 2018-01-06 | ||
* Passing null values should not throw exceptions (#353 @kkragenbrink) | ||
- Passing null values should not throw exceptions (#353 @kkragenbrink) | ||
@@ -65,3 +90,3 @@ ## [3.6.0] - 2018-01-03 | ||
* `zrangebyscore` command in addition to `unsubscribe` and `quit` stubs (#350 @usebaz) | ||
- `zrangebyscore` command in addition to `unsubscribe` and `quit` stubs (#350 @usebaz) | ||
@@ -72,3 +97,3 @@ ## [3.5.0] - 2017-12-07 | ||
* `subscribe` command stub (#348 @yitongding) | ||
- `subscribe` command stub (#348 @yitongding) | ||
@@ -79,3 +104,3 @@ ## [3.4.2] - 2017-11-28 | ||
* Remove .eslintcache file from package (#347) | ||
- Remove .eslintcache file from package (#347) | ||
@@ -86,3 +111,3 @@ ## [3.4.1] - 2017-11-28 | ||
* More detailed RunKit example (#346) | ||
- More detailed RunKit example (#346) | ||
@@ -93,3 +118,3 @@ ## [3.4.0] - 2017-11-27 | ||
* Argument and Reply Transformers (#342 @DrMegavolt) | ||
- Argument and Reply Transformers (#342 @DrMegavolt) | ||
@@ -100,3 +125,3 @@ ## [3.3.1] - 2017-11-17 | ||
* [RunKit example](https://npm.runkit.com/ioredis-mock) (#340) | ||
- [RunKit example](https://npm.runkit.com/ioredis-mock) (#340) | ||
@@ -107,4 +132,4 @@ ## [3.3.0] - 2017-11-16 | ||
* `zadd`, `zrange`, `zremrevbyrank` and `zrevrange` commands. (#321 @ddunkin) | ||
* Added support for passing objects and maps to `hmset` (#337) | ||
- `zadd`, `zrange`, `zremrevbyrank` and `zrevrange` commands. (#321 @ddunkin) | ||
- Added support for passing objects and maps to `hmset` (#337) | ||
@@ -115,4 +140,4 @@ ## [3.2.0] - 2017-11-15 | ||
* `lrange` command. (#335 @sseidametov) | ||
* `scan` command. (#334 @DrMegavolt) | ||
- `lrange` command. (#335 @sseidametov) | ||
- `scan` command. (#334 @DrMegavolt) | ||
@@ -123,3 +148,3 @@ ## [3.1.3] - 2017-11-12 | ||
* Fixed errors in smembers and srem when no data is set (#332) | ||
- Fixed errors in smembers and srem when no data is set (#332) | ||
@@ -130,3 +155,3 @@ ## [3.1.2] - 2017-11-09 | ||
* Fixed hexists edge cases. (#331 @wraytw) | ||
- Fixed hexists edge cases. (#331 @wraytw) | ||
@@ -137,3 +162,3 @@ ## [3.1.1] - 2017-10-19 | ||
* Ignore codeclimate in npm package | ||
- Ignore codeclimate in npm package | ||
@@ -144,3 +169,3 @@ ## [3.1.0] - 2017-10-03 | ||
* Added `pipeline` with method chaining (#312 @funnisimo) | ||
- Added `pipeline` with method chaining (#312 @funnisimo) | ||
@@ -151,3 +176,3 @@ ## [3.0.2] - 2017-10-02 | ||
* Added back support for node v0.10.x like ioredis. | ||
- Added back support for node v0.10.x like ioredis. | ||
@@ -158,3 +183,3 @@ ## [3.0.1] - 2017-10-02 | ||
* Removed README and RunKit references to old import style. | ||
- Removed README and RunKit references to old import style. | ||
@@ -165,7 +190,7 @@ ## [3.0.0] - 2017-10-02 | ||
* Use module.exports to be in line with ioredis. (#311 @rexxars) | ||
- Use module.exports to be in line with ioredis. (#311 @rexxars) | ||
### Fixes | ||
* Error thrown in sismember() if key does not exist. (#318 @theogravity) | ||
- Error thrown in sismember() if key does not exist. (#318 @theogravity) | ||
@@ -176,3 +201,3 @@ ## [2.4.1] - 2017-10-02 | ||
* Allow ioredis 3 as peer dependency. (#317 @aruberto) | ||
- Allow ioredis 3 as peer dependency. (#317 @aruberto) | ||
@@ -183,9 +208,9 @@ ## [2.4.0] - 2017-03-05 | ||
* `exec` supports a callback argument. (#290) | ||
- `exec` supports a callback argument. (#290) | ||
### Fixes | ||
* Don't modify objects passed to or returned from the internal datastore. (#281 | ||
- Don't modify objects passed to or returned from the internal datastore. (#281 | ||
@jeffkenney) | ||
* Fix hash get commands for missing hashes. (#284 @jeffkenney) | ||
- Fix hash get commands for missing hashes. (#284 @jeffkenney) | ||
@@ -196,12 +221,12 @@ ## [2.3.0] - 2017-02-28 | ||
* Add event emitter inheritance. (#248 @xsellier) | ||
* Trigger connect & ready events on instantiation. (#280 @rexxars) | ||
- Add event emitter inheritance. (#248 @xsellier) | ||
- Trigger connect & ready events on instantiation. (#280 @rexxars) | ||
### Changed | ||
* Prevent conversion of buffer arguments to strings. (#236 @dpikt) | ||
- Prevent conversion of buffer arguments to strings. (#236 @dpikt) | ||
### Misc | ||
* updated all dependencies to latest stable versions. (@greenkeeperio-bot) | ||
- updated all dependencies to latest stable versions. (@greenkeeperio-bot) | ||
@@ -212,8 +237,8 @@ ## [2.2.0] - 2016-10-31 | ||
* buffer operation aliases. (#234 @dpikt) | ||
* yarn lockfile. | ||
- buffer operation aliases. (#234 @dpikt) | ||
- yarn lockfile. | ||
### Changed | ||
* updated redis-commands dependency and updated the compat table with new | ||
- updated redis-commands dependency and updated the compat table with new | ||
commands. | ||
@@ -225,10 +250,10 @@ | ||
* `smove` command. (#217) | ||
* `sdiff` command. (#216) | ||
* `sunion` command. (#215) | ||
* `sinter` command. (#214) | ||
- `smove` command. (#217) | ||
- `sdiff` command. (#216) | ||
- `sunion` command. (#215) | ||
- `sinter` command. (#214) | ||
### Changed | ||
* added compat table badge to readme. (#213) | ||
- added compat table badge to readme. (#213) | ||
@@ -242,7 +267,7 @@ ## [2.0.0] - 2016-10-03 | ||
* `flushdb` command. | ||
- `flushdb` command. | ||
### Changed | ||
* Command arguments is now transformed to strings before being passed to the | ||
- Command arguments is now transformed to strings before being passed to the | ||
command itself helping the mock behave more like a real ioredis client. | ||
@@ -252,39 +277,39 @@ | ||
* `append` updated to return an integer. | ||
* `dbsize` updated to return an integer. | ||
* `decr` updated to return an integer. | ||
* `decrby` updated to return an integer. | ||
* `expire` updated to return an integer. | ||
* `expireat` updated to return an integer. | ||
* `hdel` updated to return an integer. | ||
* `hexists` updated to return an integer. | ||
* `hincrby` updated to return an integer. | ||
* `hlen` updated to return an integer. | ||
* `hset` updated to return an integer. | ||
* `hsetnx` updated to return an integer. | ||
* `hstrlen` updated to return an integer. | ||
* `incr` updated to return an integer. | ||
* `incrby` updated to return an integer. | ||
* `lpush` updated to return an integer. | ||
* `lpushx` updated to return an integer. | ||
* `mget` required a single array argument, updated to use multiple arguments | ||
- `append` updated to return an integer. | ||
- `dbsize` updated to return an integer. | ||
- `decr` updated to return an integer. | ||
- `decrby` updated to return an integer. | ||
- `expire` updated to return an integer. | ||
- `expireat` updated to return an integer. | ||
- `hdel` updated to return an integer. | ||
- `hexists` updated to return an integer. | ||
- `hincrby` updated to return an integer. | ||
- `hlen` updated to return an integer. | ||
- `hset` updated to return an integer. | ||
- `hsetnx` updated to return an integer. | ||
- `hstrlen` updated to return an integer. | ||
- `incr` updated to return an integer. | ||
- `incrby` updated to return an integer. | ||
- `lpush` updated to return an integer. | ||
- `lpushx` updated to return an integer. | ||
- `mget` required a single array argument, updated to use multiple arguments | ||
(single array support will be added later when ioredis Argument Transformers | ||
is properly implemented). | ||
* `msetnx` updated to return an integer. | ||
* `persist` updated to return an integer. | ||
* `pexpire` updated to return an integer. | ||
* `pexpireat` updated to return an integer. | ||
* `pttl` updated to return an integer. | ||
* `renamenx` updated to return an integer. | ||
* `rpush` updated to return an integer. | ||
* `rpushx` updated to return an integer. | ||
* `scard` updated to return an integer. | ||
* `setnx` updated to return an integer. | ||
* `sismember` updated to return an integer. | ||
* `strlen` updated to return an integer. | ||
* `ttl` updated to return an integer. | ||
- `msetnx` updated to return an integer. | ||
- `persist` updated to return an integer. | ||
- `pexpire` updated to return an integer. | ||
- `pexpireat` updated to return an integer. | ||
- `pttl` updated to return an integer. | ||
- `renamenx` updated to return an integer. | ||
- `rpush` updated to return an integer. | ||
- `rpushx` updated to return an integer. | ||
- `scard` updated to return an integer. | ||
- `setnx` updated to return an integer. | ||
- `sismember` updated to return an integer. | ||
- `strlen` updated to return an integer. | ||
- `ttl` updated to return an integer. | ||
### Deprecated | ||
* `hmset` no longer accepts passing an object with keys and values directly. | ||
- `hmset` no longer accepts passing an object with keys and values directly. | ||
This will be added later when ioredis Argument Transformers is properly | ||
@@ -297,16 +322,16 @@ implemented. | ||
* `type` command (#207) | ||
- `type` command (#207) | ||
### Fixed | ||
* `sadd` no longer allow duplicate values (#204 @kesla) | ||
* `hset` learned to create a new hash if not existing instead of throwing error | ||
- `sadd` no longer allow duplicate values (#204 @kesla) | ||
- `hset` learned to create a new hash if not existing instead of throwing error | ||
(#207) | ||
* `hset` updated to return integer reply according to redis spec (#207) | ||
- `hset` updated to return integer reply according to redis spec (#207) | ||
### Internal | ||
* `set` related commands (`sadd`, `scard`, etc) implemented using es6 `Set` | ||
- `set` related commands (`sadd`, `scard`, etc) implemented using es6 `Set` | ||
instead of `Array` (#204 @kesla) | ||
* `hset` tests refactored (#207) | ||
- `hset` tests refactored (#207) | ||
@@ -317,8 +342,8 @@ ## [1.14.0] - 2016-10-02 | ||
* added `scard` command (#201) | ||
* added `discard` command (#200) | ||
- added `scard` command (#201) | ||
- added `discard` command (#200) | ||
### Documentation | ||
* added CHANGELOG.md file | ||
- added CHANGELOG.md file | ||
@@ -329,14 +354,14 @@ ## [1.13.0] - 2016-10-02 | ||
* added `mset` command (#181) | ||
* added `msetnx` command (#182) | ||
* added `dbsize` command (#183) | ||
* added `lpushx` command (#184) | ||
* added `incrbyfloat` command (#185) | ||
* added `rpushx` command (#186) | ||
* added `hincrbyfloat` command (#187) | ||
* added `lpop` command (#189) | ||
* added `rpop` command (#190) | ||
* added `lindex` command (#191) | ||
* added `srandmember` command (#192) | ||
* added `lset` command (#193) | ||
- added `mset` command (#181) | ||
- added `msetnx` command (#182) | ||
- added `dbsize` command (#183) | ||
- added `lpushx` command (#184) | ||
- added `incrbyfloat` command (#185) | ||
- added `rpushx` command (#186) | ||
- added `hincrbyfloat` command (#187) | ||
- added `lpop` command (#189) | ||
- added `rpop` command (#190) | ||
- added `lindex` command (#191) | ||
- added `srandmember` command (#192) | ||
- added `lset` command (#193) | ||
@@ -347,22 +372,22 @@ ## [1.12.0] - 2016-10-02 | ||
* added `auth` command (#160) | ||
* added `bgrewriteaof` command (#161) | ||
* added `save` command (#162) | ||
* added `lastsave` command (#163) | ||
* added `bgsave` command (#164) | ||
* added `getrange` command (#165) | ||
* added `echo` command (#166) | ||
* added `randomkey` command (#167) | ||
* added `role` command (#168) | ||
* added `flushall` command (#169) | ||
* added `ping` command (#170) | ||
* added `persist` command (#171) | ||
* added `expireat` command (#172) | ||
* added `pttl` command (#173) | ||
* added `hkeys` command (#174) | ||
* added `setex` command (#175) | ||
* added `pexpireat` command (#176) | ||
* added `hlen` command (#177) | ||
* added `pexpire` command (#178) | ||
* added `psetex` command (#179) | ||
- added `auth` command (#160) | ||
- added `bgrewriteaof` command (#161) | ||
- added `save` command (#162) | ||
- added `lastsave` command (#163) | ||
- added `bgsave` command (#164) | ||
- added `getrange` command (#165) | ||
- added `echo` command (#166) | ||
- added `randomkey` command (#167) | ||
- added `role` command (#168) | ||
- added `flushall` command (#169) | ||
- added `ping` command (#170) | ||
- added `persist` command (#171) | ||
- added `expireat` command (#172) | ||
- added `pttl` command (#173) | ||
- added `hkeys` command (#174) | ||
- added `setex` command (#175) | ||
- added `pexpireat` command (#176) | ||
- added `hlen` command (#177) | ||
- added `pexpire` command (#178) | ||
- added `psetex` command (#179) | ||
@@ -373,12 +398,12 @@ ## [1.11.0] - 2016-10-01 | ||
* added `expire` command (#155) | ||
* added `ttl` command (#157) | ||
- added `expire` command (#155) | ||
- added `ttl` command (#157) | ||
### Documentation | ||
* cleaned up compat table (#158) | ||
- cleaned up compat table (#158) | ||
### Tests | ||
* circleci now run parallel builds to distribute node v4 - v6 tests between | ||
- circleci now run parallel builds to distribute node v4 - v6 tests between | ||
containers, speeding things up a bit | ||
@@ -390,3 +415,3 @@ | ||
* added `renamenx` command (#152) | ||
- added `renamenx` command (#152) | ||
@@ -397,7 +422,7 @@ ## [1.9.0] - 2016-09-26 | ||
* added `mget` command (#134 @kesla) | ||
- added `mget` command (#134 @kesla) | ||
### Misc | ||
* updated all dependencies to latest versions (thanks, @greenkeeperio-bot!) | ||
- updated all dependencies to latest versions (thanks, @greenkeeperio-bot!) | ||
@@ -408,18 +433,18 @@ ## [1.8.0] - 2016-08-13 | ||
* added `brpoplpush` command (#106 @davemcorwin) | ||
* added `llen` command (#106 @davemcorwin) | ||
* added `lpush` command (#106 @davemcorwin) | ||
* added `lrem` command (#106 @davemcorwin) | ||
* added `publish` stub (#106 @davemcorwin) | ||
* added `rpoplpush` command (#106 @davemcorwin) | ||
* added `rpush` command (#106 @davemcorwin) | ||
- added `brpoplpush` command (#106 @davemcorwin) | ||
- added `llen` command (#106 @davemcorwin) | ||
- added `lpush` command (#106 @davemcorwin) | ||
- added `lrem` command (#106 @davemcorwin) | ||
- added `publish` stub (#106 @davemcorwin) | ||
- added `rpoplpush` command (#106 @davemcorwin) | ||
- added `rpush` command (#106 @davemcorwin) | ||
### Fixes | ||
* `hmset` command supports objects (#106 @davemcorwin) | ||
* `incr` command sets default value `'0'` if not exists (#106 @davemcorwin) | ||
- `hmset` command supports objects (#106 @davemcorwin) | ||
- `incr` command sets default value `'0'` if not exists (#106 @davemcorwin) | ||
### Misc | ||
* updated all dependencies to latest versions (thanks, @greenkeeperio-bot!) | ||
- updated all dependencies to latest versions (thanks, @greenkeeperio-bot!) | ||
@@ -430,7 +455,7 @@ ## [1.7.0] - 2016-08-02 | ||
* added `keys` command (#92 @pivotal-csaa) | ||
- added `keys` command (#92 @pivotal-csaa) | ||
### Misc | ||
* updated test and linting dependencies to latest versions (thanks, | ||
- updated test and linting dependencies to latest versions (thanks, | ||
@greenkeeperio-bot!) | ||
@@ -442,7 +467,7 @@ | ||
* added `setnx` command | ||
- added `setnx` command | ||
### Bugfixes | ||
* `hsetnx` would report '0' to signal the key was a no-op but in reality did | ||
- `hsetnx` would report '0' to signal the key was a no-op but in reality did | ||
change the existing value. | ||
@@ -454,11 +479,11 @@ | ||
* added strlen command (#53) | ||
* added hdel command (#54) | ||
* added hexists command (#55) | ||
* added hincrby command (#56) | ||
* added hstrlen command (#57) | ||
- added strlen command (#53) | ||
- added hdel command (#54) | ||
- added hexists command (#55) | ||
- added hincrby command (#56) | ||
- added hstrlen command (#57) | ||
### Documentation | ||
* Added a note about tonicdev to readme (#52) | ||
- Added a note about tonicdev to readme (#52) | ||
@@ -469,3 +494,3 @@ ## [1.4.1] - 2016-06-27 | ||
* updated istanbul devDependency | ||
- updated istanbul devDependency | ||
@@ -476,9 +501,9 @@ ## [1.4.0] - 2016-06-26 | ||
* added `hmget` command | ||
* added `rename` command | ||
* added `append` command | ||
- added `hmget` command | ||
- added `rename` command | ||
- added `append` command | ||
### Bugfixes | ||
* performance penalties for using delete (#45) | ||
- performance penalties for using delete (#45) | ||
@@ -489,5 +514,5 @@ ## [1.3.0] - 2016-06-21 | ||
* added `exists` command. | ||
* added `time` command. | ||
* added `getset` command. | ||
- added `exists` command. | ||
- added `time` command. | ||
- added `getset` command. | ||
@@ -498,22 +523,22 @@ ## [1.2.0] - 2016-06-16 | ||
* added incrby and decrby commands (#34). | ||
- added incrby and decrby commands (#34). | ||
### Documentation | ||
* compat.md now links to redis docs for easy lookup. | ||
- compat.md now links to redis docs for easy lookup. | ||
## [1.1.1] - 2016-06-15 | ||
* #30 Fix regression in v1.1.0 that broke the whole module (sorry!). | ||
- #30 Fix regression in v1.1.0 that broke the whole module (sorry!). | ||
## [1.1.0] - 2016-06-14 | ||
* refactored to Bluebird promises. | ||
* node style callbacks supported, like in ioredis. | ||
* added del and decr. | ||
- refactored to Bluebird promises. | ||
- node style callbacks supported, like in ioredis. | ||
- added del and decr. | ||
## [1.0.6] - 2016-06-14 | ||
* added [compat table](https://github.com/stipsan/ioredis-mock/compat.md). | ||
* added npm preversion and prepublish scripts to prevent easy maintenance | ||
- added [compat table](https://github.com/stipsan/ioredis-mock/compat.md). | ||
- added npm preversion and prepublish scripts to prevent easy maintenance | ||
mistakes. | ||
@@ -523,27 +548,27 @@ | ||
* updated readme | ||
- updated readme | ||
## [1.0.4] - 2016-06-12 | ||
* 100% test coverage | ||
* srem and sadd accepts multiple items | ||
* added set and get commands | ||
- 100% test coverage | ||
- srem and sadd accepts multiple items | ||
- added set and get commands | ||
## [1.0.3] - 2016-06-12 | ||
* setup CircleCI to cover latest stable node releases. | ||
* incr didn't persist changes to data. | ||
- setup CircleCI to cover latest stable node releases. | ||
- incr didn't persist changes to data. | ||
## [1.0.2] - 2016-06-10 | ||
* Setup travis CI and AppVeyor integrations. | ||
* Added tests for exec, hget, hset, hsetnx and incr. | ||
* Setup coveralls and codeclimate integrations. | ||
* Fixed broken hset implementation. | ||
- Setup travis CI and AppVeyor integrations. | ||
- Added tests for exec, hget, hset, hsetnx and incr. | ||
- Setup coveralls and codeclimate integrations. | ||
- Fixed broken hset implementation. | ||
## [1.0.1] - 2016-06-09 | ||
* lodash was missing in the package.json dependencies | ||
* fixes to documentation | ||
* added tonicExample | ||
- lodash was missing in the package.json dependencies | ||
- fixes to documentation | ||
- added tonicExample | ||
@@ -554,21 +579,25 @@ ## 1.0.0 - 2016-06-09 | ||
* Integers | ||
* incr | ||
* Hashing | ||
* hset | ||
* hget | ||
* hgetall | ||
* hsetnx | ||
* hmset | ||
* hvals | ||
* Lists | ||
* sadd | ||
* srem | ||
* smembers | ||
* sismember | ||
* Transaction | ||
* multi | ||
* exec | ||
- Integers | ||
- incr | ||
- Hashing | ||
- hset | ||
- hget | ||
- hgetall | ||
- hsetnx | ||
- hmset | ||
- hvals | ||
- Lists | ||
- sadd | ||
- srem | ||
- smembers | ||
- sismember | ||
- Transaction | ||
- multi | ||
- exec | ||
[unreleased]: https://github.com/stipsan/ioredis-mock/compare/v3.8.0...HEAD | ||
[unreleased]: https://github.com/stipsan/ioredis-mock/compare/v3.9.0...HEAD | ||
[3.9.0]: https://github.com/stipsan/ioredis-mock/compare/v3.8.3...v3.9.0 | ||
[3.8.3]: https://github.com/stipsan/ioredis-mock/compare/v3.8.2...v3.8.3 | ||
[3.8.2]: https://github.com/stipsan/ioredis-mock/compare/v3.8.1...v3.8.2 | ||
[3.8.1]: https://github.com/stipsan/ioredis-mock/compare/v3.8.0...v3.8.1 | ||
[3.8.0]: https://github.com/stipsan/ioredis-mock/compare/v3.7.1...v3.8.0 | ||
@@ -575,0 +604,0 @@ [3.7.1]: https://github.com/stipsan/ioredis-mock/compare/v3.7.0...v3.7.1 |
@@ -1147,2 +1147,14 @@ 'use strict'; | ||
var _zincrby = require('./zincrby'); | ||
Object.keys(_zincrby).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _zincrby[key]; | ||
} | ||
}); | ||
}); | ||
var _zrange = require('./zrange'); | ||
@@ -1172,2 +1184,14 @@ | ||
var _zrem = require('./zrem'); | ||
Object.keys(_zrem).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _zrem[key]; | ||
} | ||
}); | ||
}); | ||
var _zremrangebyrank = require('./zremrangebyrank'); | ||
@@ -1197,2 +1221,14 @@ | ||
var _zrevrangebyscore = require('./zrevrangebyscore'); | ||
Object.keys(_zrevrangebyscore).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _zrevrangebyscore[key]; | ||
} | ||
}); | ||
}); | ||
var _zscan = require('./zscan'); | ||
@@ -1199,0 +1235,0 @@ |
@@ -1,2 +0,2 @@ | ||
"use strict"; | ||
'use strict'; | ||
@@ -7,2 +7,4 @@ Object.defineProperty(exports, "__esModule", { | ||
exports.slice = slice; | ||
exports.parseLimit = parseLimit; | ||
exports.filterPredicate = filterPredicate; | ||
function normalizeIndex(index, array) { | ||
@@ -24,2 +26,34 @@ if (index < 0) { | ||
return arr.slice(start, end + 1); | ||
} | ||
function parseLimit(input) { | ||
var str = '' + input; | ||
var strict = false; | ||
if (str[0] === '(') { | ||
str = str.substr(1, str.length); | ||
strict = true; | ||
} else if (str === '-inf') { | ||
return { value: -Infinity, isStrict: true }; | ||
} else if (str === '+inf') { | ||
return { value: +Infinity, isStrict: true }; | ||
} | ||
return { | ||
value: parseInt(str, 10), | ||
isStrict: strict | ||
}; | ||
} | ||
function filterPredicate(min, max) { | ||
return function (it) { | ||
if (it.score < min.value || min.isStrict && it.score === min.value) { | ||
return false; | ||
} | ||
if (it.score > max.value || max.isStrict && it.score === max.value) { | ||
return false; | ||
} | ||
return true; | ||
}; | ||
} |
@@ -18,37 +18,7 @@ 'use strict'; | ||
var _zrangeCommand = require('./zrange-command.common'); | ||
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; } | ||
function parseLimit(input) { | ||
var str = '' + input; | ||
var strict = false; | ||
if (str[0] === '(') { | ||
str = str.substr(1, str.length); | ||
strict = true; | ||
} else if (str === '-inf') { | ||
return { value: -Infinity, isStrict: true }; | ||
} else if (str === '+inf') { | ||
return { value: +Infinity, isStrict: true }; | ||
} | ||
return { | ||
value: parseInt(str, 10), | ||
isStrict: strict | ||
}; | ||
} | ||
function filterPredicate(min, max) { | ||
return function (it) { | ||
if (it.score < min.value || min.isStrict && it.score === min.value) { | ||
return false; | ||
} | ||
if (it.score > max.value || max.isStrict && it.score === max.value) { | ||
return false; | ||
} | ||
return true; | ||
}; | ||
} | ||
function zrangebyscore(key, inputMin, inputMax) { | ||
function zrangebyscore(key, inputMin, inputMax, withScores) { | ||
var map = this.data.get(key); | ||
@@ -63,9 +33,15 @@ if (!map) { | ||
var min = parseLimit(inputMin); | ||
var max = parseLimit(inputMax); | ||
var filteredArray = (0, _lodash.filter)((0, _arrayFrom2.default)(map.values()), filterPredicate(min, max)); | ||
var min = (0, _zrangeCommand.parseLimit)(inputMin); | ||
var max = (0, _zrangeCommand.parseLimit)(inputMax); | ||
var filteredArray = (0, _lodash.filter)((0, _arrayFrom2.default)(map.values()), (0, _zrangeCommand.filterPredicate)(min, max)); | ||
return (0, _lodash.orderBy)(filteredArray, 'score').map(function (it) { | ||
var ordered = (0, _lodash.orderBy)(filteredArray, 'score'); | ||
if (withScores === 'WITHSCORES') { | ||
return (0, _lodash.flatMap)(ordered, function (it) { | ||
return [it.value, it.score]; | ||
}); | ||
} | ||
return ordered.map(function (it) { | ||
return it.value; | ||
}); | ||
} |
@@ -59,7 +59,7 @@ { | ||
"ioredis": "3.2.2", | ||
"lint-staged": "7.1.2", | ||
"lint-staged": "7.1.3", | ||
"mocha": "3.5.3", | ||
"mocha-circleci-reporter": "0.0.2", | ||
"nyc": "11.8.0", | ||
"prettier": "1.12.1", | ||
"nyc": "11.9.0", | ||
"prettier": "1.13.4", | ||
"prettier-package-json": "1.6.0", | ||
@@ -119,3 +119,3 @@ "redis-commands": "1.3.5", | ||
"runkitExampleFilename": "example.js", | ||
"version": "3.8.3" | ||
"version": "3.9.0" | ||
} |
@@ -1,2 +0,2 @@ | ||
# ioredis-mock · [](https://circleci.com/gh/stipsan/ioredis-mock) [](https://ci.appveyor.com/project/stipsan/ioredis-mock) [](https://npm-stat.com/charts.html?package=ioredis-mock) [](https://www.npmjs.com/package/ioredis-mock) [](compat.md) [](https://github.com/semantic-release/semantic-release) | ||
# ioredis-mock · [](https://circleci.com/gh/stipsan/ioredis-mock) [](https://ci.appveyor.com/project/stipsan/ioredis-mock) [](https://npm-stat.com/charts.html?package=ioredis-mock) [](https://www.npmjs.com/package/ioredis-mock) [](compat.md) [](https://github.com/semantic-release/semantic-release) | ||
@@ -10,10 +10,10 @@ This library emulates [ioredis](https://github.com/luin/ioredis) by performing | ||
* Your workflow already use a local redis-server instance for the dev server. | ||
* You're on a platform | ||
- Your workflow already use a local redis-server instance for the dev server. | ||
- You're on a platform | ||
[without an official redis release](https://github.com/MSOpenTech/redis), | ||
that's even worse than using an emulator. | ||
* You're running tests on a CI, setting it up is complicated. If you combine it | ||
- You're running tests on a CI, setting it up is complicated. If you combine it | ||
with CI that also run selenium acceptance testing it's even more complicated, | ||
as two redis-server instances on the same CI build is hard. | ||
* The GitHub repo have bots that run the testing suite and is limited through | ||
- The GitHub repo have bots that run the testing suite and is limited through | ||
npm package.json install scripts and can't fire up servers. (Having | ||
@@ -51,13 +51,13 @@ [Greenkeeper](https://greenkeeper.io/) notifying you when a new release of | ||
* [x] Setup testing suite for the library itself. | ||
* [x] Refactor to bluebird promises like ioredis, support node style callback | ||
- [x] Setup testing suite for the library itself. | ||
- [x] Refactor to bluebird promises like ioredis, support node style callback | ||
too. | ||
* [x] Implement remaining basic features that read/write data. | ||
* [x] Implement ioredis | ||
- [x] Implement remaining basic features that read/write data. | ||
- [x] Implement ioredis | ||
[argument and reply transformers](https://github.com/luin/ioredis#transforming-arguments--replies). | ||
* [ ] Connection Events | ||
* [ ] Offline Queue | ||
* [ ] Pub/Sub | ||
* [ ] Error Handling | ||
* [ ] Implement [remaining](compat.md) commands | ||
- [ ] Connection Events | ||
- [ ] Offline Queue | ||
- [ ] Pub/Sub | ||
- [ ] Error Handling | ||
- [ ] Implement [remaining](compat.md) commands | ||
@@ -64,0 +64,0 @@ ## I need a feature not listed here |
123438
123
3125