New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ioredis-mock

Package Overview
Dependencies
Maintainers
1
Versions
195
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ioredis-mock - npm Package Compare versions

Comparing version 5.4.1 to 5.5.0

6

lib/commands/linsert.js

@@ -19,7 +19,7 @@ "use strict";

switch (position) {
case `BEFORE`:
case 'BEFORE':
elementIndex = pivotIndex;
break;
case `AFTER`:
case 'AFTER':
elementIndex = pivotIndex + 1;

@@ -29,3 +29,3 @@ break;

default:
throw new Error(`The position of the new element must be BEFORE the pivot or AFTER the pivot`);
throw new Error('The position of the new element must be BEFORE the pivot or AFTER the pivot');
}

@@ -32,0 +32,0 @@

@@ -31,2 +31,3 @@ "use strict";

/* eslint-disable max-classes-per-file */
const defaultOptions = {

@@ -151,2 +152,13 @@ data: {},

};
module.exports = RedisMock;
class RedisClusterMock extends RedisMock {
constructor(nodesOptions) {
super();
this.nodes = [];
nodesOptions.forEach(options => this.nodes.push(new RedisMock(options)));
}
}
module.exports = RedisMock;
module.exports.Cluster = RedisClusterMock;

@@ -21,2 +21,4 @@ {

"scripts": {
"build:babel": "npx rimraf lib && npx mkdirp lib && babel src --out-dir lib",
"build:jest.js": "esbuild src/index.js --bundle --external:fengari --external:fengari-interop --external:lodash --external:minimatch --external:standard-as-callback --outfile=jest.js --platform=node --target=node10",
"codeclimate": "codeclimate-test-reporter < ./coverage/lcov.info",

@@ -27,4 +29,2 @@ "precoverage": "npx rimraf coverage && npx mkdirp coverage",

"lint": "eslint .",
"build:babel": "npx rimraf lib && npx mkdirp lib && babel src --out-dir lib",
"build:jest.js": "esbuild src/index.js --bundle --external:fengari --external:fengari-interop --external:lodash --external:minimatch --external:standard-as-callback --outfile=jest.js --platform=node --target=node10",
"prepublishOnly": "yarn build:babel && yarn build:jest.js",

@@ -56,3 +56,3 @@ "semantic-release": "semantic-release pre && npm publish && semantic-release post",

"coveralls": "^3.1.0",
"esbuild": "^0.9.6",
"esbuild": "^0.11.0",
"eslint": "^7.13.0",

@@ -120,2 +120,6 @@ "eslint-config-airbnb-base": "^14.2.1",

},
"prettier": {
"singleQuote": true,
"trailingComma": "es5"
},
"release": {

@@ -127,3 +131,3 @@ "prepare": [

"runkitExampleFilename": "example.js",
"version": "5.4.1"
"version": "5.5.0"
}

@@ -1,2 +0,2 @@

# ioredis-mock &middot; [![npm](https://img.shields.io/npm/dm/ioredis-mock.svg?style=flat-square)](https://npm-stat.com/charts.html?package=ioredis-mock) [![npm version](https://img.shields.io/npm/v/ioredis-mock.svg?style=flat-square)](https://www.npmjs.com/package/ioredis-mock) [![Redis Compatibility: 61%](https://img.shields.io/badge/redis-61%25-yellow.svg?style=flat-square)](compat.md) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release)
# ioredis-mock &middot; [![npm](https://img.shields.io/npm/dm/ioredis-mock.svg?style=flat-square)](https://npm-stat.com/charts.html?package=ioredis-mock) [![npm version](https://img.shields.io/npm/v/ioredis-mock.svg?style=flat-square)](https://www.npmjs.com/package/ioredis-mock) [![Redis Compatibility: 30%](https://img.shields.io/badge/redis-30%25-orange.svg?style=flat-square)](compat.md) [![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg?style=flat-square)](https://github.com/semantic-release/semantic-release)

@@ -125,2 +125,14 @@ This library emulates [ioredis](https://github.com/luin/ioredis) by performing

### Cluster(Experimental)
Work on Cluster support has started, the current implementation is minimal and PRs welcome #359
```js
var Redis = require('ioredis-mock');
const cluster = new Redis.Cluster(['redis://localhost:7001']);
const nodes = cluster.nodes;
expect(nodes.length).toEqual(1);
```
## Roadmap

@@ -127,0 +139,0 @@

Sorry, the diff of this file is too big to display

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