tc39 / source-map

Source map specification, RFCs and new proposals.
https://tc39.es/source-map/
Other
123 stars 16 forks source link

Editorial: add a 'decode a list of base64 VLQ' algorithm #130

Open szuend opened 1 week ago

szuend commented 1 week ago

This PR extracts a 'decode a list of base64 VLQ' algorithm that consumes a string wholly and returns all contained VLQ numbers as a list. We can share this algorithm between decoding mappings and originalScopes/generatedRanges of the scopes proposal.

It also makes the algorithm slightly more readable as we can get rid of position and we don't necessarily need the relative* variables as they only have a single use-site.