microsoft / microsoft/node-jsonc-parser
Feature request: Support (optional) bigint during parsing
Open
Nobody has claimed this yet.
- Dominant language
- TypeScript
- Stars
- 759
- Forks
- 66
- Avg merge
- 5d 10h
- Merged PRs (30d)
- 7
Description
Currently, number literal will be parsed by the following code:
It would be better to add a feature that allow detecting the number and parsing it with BigInt, like:
// -9007199254740991 ~ 9007199254740991
// More precise checking could be used, here's only a demo
if (/^-?\d{16,}$/.test(tokenValue)) {
value = BigInt(tokenValue)
}
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start with src/impl/parser.ts around lines 515-519, where number literals are currently parsed. Trace how parsed values are exposed and determine where an optional bigint behavior could be configured. Done means large integer literals can be parsed with BigInt when requested without changing default parsing behavior.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- typescript
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100