Skip to content

Commit

Permalink
fix: sorted lists should throw WRONGTYPE instead of returning empty a…
Browse files Browse the repository at this point in the history
…rrays
  • Loading branch information
stipsan committed Apr 11, 2023
1 parent ae70c86 commit b46b9b8
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/commands/zrange-command.common.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,9 @@ export function zrangeBaseCommand(

// @TODO investigate a more stable way to detect sorted lists
if (this.data.has(key) && !(this.data.get(key) instanceof Map)) {
return []
throw new Error(
'WRONGTYPE Operation against a key holding the wrong kind of value'
)
}

let withScores = false
Expand Down

0 comments on commit b46b9b8

Please sign in to comment.