Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
itanka9 committed Nov 15, 2024
1 parent 9ce854d commit 44bedfc
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/json2pbf.ts
Original file line number Diff line number Diff line change
Expand Up @@ -254,7 +254,7 @@ export function unpackJson(arr: ArrayBuffer, options?: UnpackOptions) {
throw new Error(`Version ${version} is not supported`);
}
const packMethod: PackMethod = (header >> 16) & 0xff;
const unpackMethod: UnpackMethod = options?.method ?? UnpackMethod.Generic;
const unpackMethod: UnpackMethod = options?.method ?? packMethod as any;

if (packMethod === PackMethod.Generic && unpackMethod !== UnpackMethod.Generic) {
throw new Error('Packed with PackMethod.Generic cannot be unpacked with anything than UnpackMethod.Generic');
Expand Down

0 comments on commit 44bedfc

Please sign in to comment.