`originalPositionFor(generatedPosition)` fails on string positions
Nobody has claimed this yet.
- Dominant language
- JavaScript
- Stars
- 3.7k
- Forks
- 370
- PR merge metrics
- No merged PRs in 30d
Description
I was sending in strings instead of numbers to the originalPositionFor function. This works unless the strings aren't exactly in the mappings. E.g. originalPositionFor({line:"8", column:"10"}) would work if the sourcemap contained that exact entry, but if it instead contained line 8, column 8 and line 8 column 12, it wouldn't find the sourcemap.
Please mention that line and column MUST be number (not strings) in the readme documentation.
Contributor guide
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
Open the README documentation and find the description of originalPositionFor(generatedPosition). Update it to state that line and column must be numbers rather than strings, using the reported string-position example to clarify the requirement. Done means the README explicitly documents the expected numeric types.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- documentation
- Issue type
- Documentation
- Difficulty
- 1/5
- Estimated time
- Under an hour
- Activity status
- Stale
- Clarity
- Clearly specified
- Newbie friendliness
- 45/100