Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: #1154 getBuffer matching ioredis #1155

Merged
merged 3 commits into from
Feb 27, 2022

Conversation

ryanwitt
Copy link
Contributor

fixes #1154

@ryanwitt
Copy link
Contributor Author

Just realizing there are a bunch of other places to check besides getBuffer, here. 😅

@ryanwitt
Copy link
Contributor Author

$ git grep ".toString()" -- src
src/command.js:  return arg instanceof Buffer ? arg : arg.toString()
src/commands/decr.js:  this.data.set(key, nextVal.toString())
src/commands/decrby.js:  this.data.set(key, nextVal.toString())
src/commands/defineCommand.js:      interop.push(vm.L, ['error', err.toString()])
src/commands/get.js:    return value.toString()
src/commands/hincrby.js:  hash[field] = nextVal.toString()
src/commands/hincrbyfloat.js:  hash[field] = (curVal + parseFloat(increment)).toString()
src/commands/incr.js:  this.data.set(key, nextVal.toString())
src/commands/incrby.js:  this.data.set(key, nextVal.toString())
src/commands/incrbyfloat.js:  this.data.set(key, (curVal + parseFloat(increment)).toString())
src/commands/object.js:    if ([...val].every(n => n === parseInt(n, 10).toString())) {
src/commands/object.js:    if (val === parseInt(val, 10).toString()) {
src/commands/zincrby.js:  return score.toString()
src/commands/zscan.js:    zKeys.push([value, score.toString()])
src/commands/zscore.js:  return entry.score.toString()

Seems like get.js was the only place where this was happening in a bad way.

Copy link
Owner

@stipsan stipsan left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, thanks @ryanwitt! 🥳

@stipsan stipsan merged commit e1a9110 into stipsan:main Feb 27, 2022
@stipsan
Copy link
Owner

stipsan commented Feb 27, 2022

🎉 This PR is included in version 7.1.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

getBuffer() does not match the behavior of ioredis
2 participants