Skip to content

Commit

Permalink
feat: add zscoreBuffer
Browse files Browse the repository at this point in the history
  • Loading branch information
stipsan committed May 8, 2022
1 parent b46520e commit 9bdc5cf
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 6 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# 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: 59%](https://img.shields.io/badge/redis-59%25-red.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 · [![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: 63%](https://img.shields.io/badge/redis-63%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)

This library emulates [ioredis](https://github.com/luin/ioredis) by performing
all operations in-memory. The best way to do integration testing against redis
Expand Down
6 changes: 1 addition & 5 deletions compat.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Supported commands ![Commands Coverage: 59%](https://img.shields.io/badge/coverage-59%25-red.svg)
## Supported commands ![Commands Coverage: 63%](https://img.shields.io/badge/coverage-63%25-orange.svg)

> PRs welcome :heart:
Expand Down Expand Up @@ -231,10 +231,6 @@
| [zunion] | :white_check_mark: | :x: |
| [zunionstore] | :white_check_mark: | :x: |

## Missing buffer commands

- [zscoreBuffer][1]

## Commands that won't be implemented

> This is just the current status, and may change in the future. If you have ideas on how to implement any of them feel free to tell us about it.
Expand Down
7 changes: 7 additions & 0 deletions src/commands/zscore.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import { convertStringToBuffer } from '../commands-utils/convertStringToBuffer'

export function zscore(key, member) {
const map = this.data.get(key)

Expand All @@ -14,3 +16,8 @@ export function zscore(key, member) {

return entry.score.toString()
}

export function zscoreBuffer(...args) {
const val = zscore.apply(this, args)
return convertStringToBuffer(val)
}

0 comments on commit 9bdc5cf

Please sign in to comment.