File tree Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Expand file tree Collapse file tree 2 files changed +17
-8
lines changed Original file line number Diff line number Diff line change 33## v3.0.3
44
55- fix(command): Return keys in ` HMGET ` command correctly.
6+ - fix(protocol): decode ` *-1 ` correctly
67
78## v3.0.2
89
Original file line number Diff line number Diff line change @@ -234,24 +234,32 @@ export class Decoder extends EventEmitter implements C.IDecoder {
234234
235235 if ( end > - 1 ) {
236236
237- this . _ctx . type = C . EDataType . LIST ;
238-
239- this . _ctx . value = [ ] ;
240-
241237 this . _ctx . data . length = parseInt ( this . _buf . subarray (
242238 this . _ctx . pos ,
243239 end
244240 ) . toString ( ) ) ;
245241
246- if ( this . _ctx . data . length === 0 || this . _ctx . data . length === - 1 ) {
242+ if ( this . _ctx . data . length === - 1 ) {
247243
244+ this . _ctx . type = C . EDataType . NULL ;
245+ this . _ctx . value = null ;
248246 this . _pop ( end + 2 ) ;
249247 }
250248 else {
251249
252- this . _cut ( end + 2 ) ;
253- this . _ctx . pos = this . _cursor ;
254- this . _ctx . status = EDecodeStatus . READING_LIST ;
250+ this . _ctx . type = C . EDataType . LIST ;
251+ this . _ctx . value = [ ] ;
252+
253+ if ( this . _ctx . data . length === 0 ) {
254+
255+ this . _pop ( end + 2 ) ;
256+ }
257+ else {
258+
259+ this . _cut ( end + 2 ) ;
260+ this . _ctx . pos = this . _cursor ;
261+ this . _ctx . status = EDecodeStatus . READING_LIST ;
262+ }
255263 }
256264 }
257265 else {
You can’t perform that action at this time.
0 commit comments