mcollina / mcollina/msgpack5

BigInt not supported

Open
#80 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
JavaScript
Stars
499
Forks
77
PR merge metrics
No merged PRs in 30d

Description

require('msgpack5')().encode({a: 10n})
Uncaught Error: not implemented yet

I am a bit surprised that it isn't possible to write a decoder for this. I tried, but I get the same error, since msgpack5 never seems to try to get the value converted:

const m = require('msgpack5')()
m.registerEncoder((t) => (t instanceof BigInt), t => t.toString(10))
m..encode({a: 10n})
Uncaught Error: not implemented yet

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the issue with msgpack5().encode({a: 10n}) and compare it with the registerEncoder attempt shown in the report. Trace how BigInt values reach the encoder and determine the intended encoded and decoded representation; done means BigInt values no longer raise the reported error and the behavior is covered by tests.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.