Skip to content

Commit 3b62145

Browse files
committed
fix index of built-in encoders/decoders (close #241)
1 parent 43ac9ce commit 3b62145

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/ExtensionCodec.ts

+1-1
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export class ExtensionCodec<ContextType = undefined> implements ExtensionCodecTy
5757
this.decoders[type] = decode;
5858
} else {
5959
// built-in extensions
60-
const index = 1 + type;
60+
const index = -1 - type;
6161
this.builtInEncoders[index] = encode;
6262
this.builtInDecoders[index] = decode;
6363
}

0 commit comments

Comments
 (0)