File tree Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Expand file tree Collapse file tree 1 file changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -92,12 +92,12 @@ export class Queue<
9292 protected stats : QueueStats ;
9393
9494 /** Wrap the payload in a JSON encoding */
95- static encodePayload ( p : unknown ) {
95+ static encodePayload ( this : void , p : unknown ) {
9696 return JSON . stringify ( { _ : p } ) ;
9797 }
9898
9999 /** Decode the payload, stripping away the outer JSON encoding */
100- static decodePayload < T > ( s : string | null | unknown ) {
100+ static decodePayload < T > ( this : void , s : string | null | unknown ) {
101101 return JSON . parse ( ( s as string ) ?? "{}" ) . _ as T ;
102102 }
103103
@@ -117,8 +117,12 @@ export class Queue<
117117 } ,
118118 statInterval :
119119 options ?. statInterval === 0 ? 0 : options ?. statInterval ?? 5 ,
120- decodePayload : options ?. decodePayload ?? this . constructor . decodePayload ,
121- encodePayload : options ?. encodePayload ?? this . constructor . encodePayload ,
120+ decodePayload :
121+ options ?. decodePayload ??
122+ ( this . constructor as typeof Queue ) . decodePayload ,
123+ encodePayload :
124+ options ?. encodePayload ??
125+ ( this . constructor as typeof Queue ) . encodePayload ,
122126 } ;
123127
124128 // initialize stats
You can’t perform that action at this time.
0 commit comments