Skip to content

Commit ed3388c

Browse files
authored
Merge pull request #256 from msgpack/fix_index
fix index of built-in encoders/decoders
2 parents 43ac9ce + 3b62145 commit ed3388c

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)