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 2.4.0 to 2.4.1

.circleci/config.yml

11

CHANGELOG.md

@@ -1,8 +0,9 @@

# ioredis-mock change log
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).
The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](http://semver.org/spec/v2.0.0.html).
## [Unreleased]
## [2.4.0] - 2017-03-05

@@ -330,3 +331,3 @@

[Unreleased]: https://github.com/stipsan/ioredis-mock/compare/v2.4.0...HEAD
[v2.4.0]: https://github.com/stipsan/ioredis-mock/compare/v2.3.0...v2.4.0
[2.4.0]: https://github.com/stipsan/ioredis-mock/compare/v2.3.0...v2.4.0
[2.3.0]: https://github.com/stipsan/ioredis-mock/compare/v2.2.0...v2.3.0

@@ -333,0 +334,0 @@ [2.2.0]: https://github.com/stipsan/ioredis-mock/compare/v2.1.0...v2.2.0

@@ -7,6 +7,40 @@ 'use strict';

exports.set = set;
var _index = require('./index');
function createGroupedArray(arr, groupSize) {
var groups = [];
for (var i = 0; i < arr.length; i += groupSize) {
groups.push(arr.slice(i, i + groupSize));
}
return groups;
}
function set(key, value) {
for (var _len = arguments.length, options = Array(_len > 2 ? _len - 2 : 0), _key = 2; _key < _len; _key++) {
options[_key - 2] = arguments[_key];
}
var nx = options.indexOf('NX') !== -1;
var xx = options.indexOf('XX') !== -1;
var filteredOptions = options.filter(function (option) {
return option !== 'NX' && option !== 'XX';
});
if (nx && xx) throw new Error('ERR syntax error');
if (nx && this.data.has(key)) return null;
if (xx && !this.data.has(key)) return null;
this.data.set(key, value);
this.expires.delete(key);
var expireOptions = new Map(createGroupedArray(filteredOptions, 2));
var ttlSeconds = expireOptions.get('EX') || expireOptions.get('PX') / 1000.0;
if (ttlSeconds) {
_index.expire.call(this, key, ttlSeconds);
} else {
this.expires.delete(key);
}
return 'OK';
}
{
"name": "ioredis-mock",
"version": "2.4.0",
"description": "This library emulates ioredis by performing all operations in-memory.",

@@ -9,7 +8,6 @@ "main": "./lib",

"prepublish": "npm run clean && npm run build",
"postpublish": "gh-release",
"preversion": "node scripts/update-compat && git add . && git commit --allow-empty -m \"chore(compat): update feature table\"",
"postversion": "git add package.json && git commit -m \"chore(package): update version\"",
"prepush": "node scripts/update-compat && git add compat.md README.md && git commit --quiet -m \"Chore: Update feature compat table\" &> /dev/null || true",
"build": "mkdirp lib && babel src --out-dir lib",
"build:watch": "npm run build -- --watch",
"pretest": "printf \"node \" && node --version",
"test": "mocha --compilers js:babel-register --recursive",

@@ -20,4 +18,13 @@ "test:watch": "npm test -- --watch --growl",

"codeclimate": "codeclimate-test-reporter < ./coverage/lcov.info",
"coverage": "npm run coveralls && npm run codeclimate"
"coverage": "npm run coveralls && npm run codeclimate",
"changelog:preview": "sr-changelog",
"changelog:commit": "sr-changelog commit",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
"release": {
"analyzeCommits": "semantic-release-tamia/analyzeCommits",
"verifyConditions": "condition-circle",
"generateNotes": "semantic-release-tamia/generateNotes",
"verifyRelease": "semantic-release-tamia/verifyRelease"
},
"repository": {

@@ -53,21 +60,22 @@ "type": "git",

"peerDependencies": {
"ioredis": "2.x"
"ioredis": "2.x || 3.x"
},
"devDependencies": {
"babel-cli": "6.23.0",
"babel-eslint": "7.1.1",
"babel-preset-es2015": "6.22.0",
"babel-register": "6.23.0",
"babel-cli": "6.24.1",
"babel-eslint": "7.2.1",
"babel-preset-es2015": "6.24.0",
"babel-register": "6.24.0",
"codeclimate-test-reporter": "0.4.1",
"coveralls": "2.11.16",
"eslint": "3.17.0",
"eslint-config-airbnb-base": "11.1.1",
"coveralls": "2.13.0",
"eslint": "3.19.0",
"eslint-config-airbnb-base": "11.1.3",
"eslint-plugin-import": "2.2.0",
"expect": "1.20.2",
"gh-release": "2.2.1",
"growl": "1.9.2",
"ioredis": "2.5.0",
"husky": "^0.14.3",
"ioredis": "^3.1.1",
"istanbul": "1.1.0-alpha.1",
"mkdirp": "0.5.1",
"mocha": "3.2.0",
"release-relief": "^1.0.1",
"rimraf": "2.6.1"

@@ -83,3 +91,4 @@ },

"redis-commands": "1.3.1"
}
}
},
"version": "2.4.1"
}

@@ -1,17 +0,3 @@

ioredis-mock
============
# ioredis-mock &middot; [![CircleCI Status](https://img.shields.io/circleci/project/github/stipsan/ioredis-mock.svg?style=flat-square)](https://circleci.com/gh/stipsan/ioredis-mock) [![AppVeyor branch](https://img.shields.io/appveyor/ci/stipsan/ioredis-mock/master.svg?style=flat-square&label=win)](https://ci.appveyor.com/project/stipsan/ioredis-mock) [![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: 49%](https://img.shields.io/badge/redis-49%25-yellow.svg?style=flat-square)](compat.md)
[![Greenkeeper badge](https://badges.greenkeeper.io/stipsan/ioredis-mock.svg)](https://greenkeeper.io/)
[![AppVeyor branch](https://img.shields.io/appveyor/ci/stipsan/ioredis-mock/master.svg?label=windows)](https://ci.appveyor.com/project/stipsan/ioredis-mock)
[![Travis branch](https://img.shields.io/travis/stipsan/ioredis-mock/master.svg?label=linux)](https://travis-ci.org/stipsan/ioredis-mock)
[![CircleCI](https://img.shields.io/circleci/project/stipsan/ioredis-mock/master.svg?label=node+matrix)](https://circleci.com/gh/stipsan/ioredis-mock)
[![Code Climate](https://codeclimate.com/github/stipsan/ioredis-mock/badges/gpa.svg)](https://codeclimate.com/github/stipsan/ioredis-mock)
[![Coverage Status](https://coveralls.io/repos/github/stipsan/ioredis-mock/badge.svg)](https://coveralls.io/github/stipsan/ioredis-mock)
[![Redis Compatibility: 49%](https://img.shields.io/badge/redis-49%25-yellow.svg)](compat.md)
[![npm package](https://img.shields.io/npm/dm/ioredis-mock.svg)](https://www.npmjs.com/package/ioredis-mock)
[![NPM](https://nodei.co/npm/ioredis-mock.png?downloadRank=true)](https://www.npmjs.com/package/ioredis-mock)
[![NPM](https://nodei.co/npm-dl/ioredis-mock.png?months=3&height=2)](https://nodei.co/npm/ioredis-mock/)
This library emulates [ioredis](https://github.com/luin/ioredis) by performing all operations in-memory.

@@ -18,0 +4,0 @@ The best way to do integration testing against redis and ioredis is on a real redis-server instance.

@@ -71,4 +71,4 @@ require('babel-register');

fs.writeFile(readme, readmeMd.toString().replace(
/\[!\[.+\(compat\.md\)/g,
`[![Redis Compatibility: ${percentage}%](https://img.shields.io/badge/redis-${percentage}%25-${color}.svg)](compat.md)`
/\[!\[Redis.+\]\(compat\.md\)/g,
`[![Redis Compatibility: ${percentage}%](https://img.shields.io/badge/redis-${percentage}%25-${color}.svg?style=flat-square)](compat.md)`
), 'utf8', (err2) => {

@@ -75,0 +75,0 @@ if (err2) throw err2;

Sorry, the diff of this file is not supported yet

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