Skip to content

Commit

Permalink
Check bulk reply type strictly (#51)
Browse files Browse the repository at this point in the history
  • Loading branch information
suguru03 authored Feb 28, 2020
1 parent 58a197f commit 4eb9a79
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion redis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -525,7 +525,8 @@ class RedisImpl implements Redis {
...args: (string | number)[]
): Promise<BulkResult> {
const [_, reply] = await this.executor.execRawReply(command, ...args);
if (typeof reply !== "string" && reply != null) {
// Note: `reply != null` won't work when `strict` is false #50
if (typeof reply !== "string" && typeof reply !== 'undefined') {
throw new Error();
}
return reply;
Expand Down

0 comments on commit 4eb9a79

Please sign in to comment.