Source Map v3 comment conversion
@stackline/convert-source-map
Encode, decode, find, and remove source-map comments with the established API, first-party types, and a linear source scanner.
npm install @stackline/convert-source-map
v1.0.1Zero runtime dependenciesNode 12+TypeScript 3.9-7.0
Runs the production browser bundle
Source-map converter
Input
Source Map JSONOutput
Lowest-change migration
Keep the original import name
Use an npm alias when existing build code requires convert-source-map.
npm install convert-source-map@npm:@stackline/convert-source-mapconst convert = require('convert-source-map');Public contract
Conversion and scanning API
| API | Purpose | Return |
|---|---|---|
fromComment(comment) | Decode an inline data URI | Converter |
fromSource(source) | Find the last inline map | Converter or null |
removeComments(source) | Remove inline maps in one scan | String |
fromObject(map) | Create a mutable converter | Converter |
toComment(options?) | Create line or block comments | String |
Release evidence
Parser behavior is measured
- 19
- focused regression tests
- 10
- differential upstream scenarios
- 500k
- malformed lines in the resource test
- 0
- runtime dependencies
Machine-readable documentation
AI and crawler resources
#Stackline #SourceMaps #JavaScript #OpenSource #NPM #AIReadyDocs