Skip to content

Commit baec25b

Browse files
committed
use optional chaining added in TypeScript 3.7
1 parent 18ce517 commit baec25b

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/Decoder.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -477,7 +477,7 @@ export class Decoder {
477477

478478
const offset = this.pos + headerOffset;
479479
let object: string;
480-
if (this.cachedKeyDecoder && this.stateIsMapKey() && this.cachedKeyDecoder.canBeCached(byteLength)) {
480+
if (this.stateIsMapKey() && this.cachedKeyDecoder?.canBeCached(byteLength)) {
481481
object = this.cachedKeyDecoder.decode(this.bytes, offset, byteLength);
482482
} else if (TEXT_ENCODING_AVAILABLE && byteLength > TEXT_DECODER_THRESHOLD) {
483483
object = utf8DecodeTD(this.bytes, offset, byteLength);

0 commit comments

Comments
 (0)