Versioned project notes for @stackline/inline-source-map 1.0.5. Original attribution is retained in the linked repository.
Compatibility Contract
Reference: [email protected] plus merged upstream master 0.6.4.
Preserved public surface
require(package)returns a callable factory.factory.Generatorexposes the constructor.- Calling the factory without
newreturns aGeneratorinstance. - Options:
file,sourceRoot, andcharset. - Methods:
addMappings,addGeneratedMappings,addSourceContent,base64Encode,inlineMappingUrl,toJSON,toString,_mappings, andgen. - Add methods return the same generator for chaining.
- Empty source text still generates one identity mapping.
- A supplied offset applies line and column to every generated mapping.
- Missing offset fields are written back as zero to a supplied mutable offset.
- Mappings without
originalremain generated-only segments. - Missing or non-string source content appears as
null. - Empty string source content remains an empty string.
- Inline comments use
//#,charset=<value>, and base64 JSON. toString()is the compact JSON serialization oftoJSON().
Intentional compatible improvements
- Null-prototype and shadowed-
hasOwnPropertyoffsets no longer throw solely because of the ownership check. __proto__,prototype, andconstructorsource names retain content safely.- Browsers can encode UTF-8 without a Buffer polyfill.
- TypeScript declarations are additive.
- Node ESM default import is verified against the CommonJS implementation.
Underlying generator update
gen() returns SourceMapGenerator from [email protected]. Its generator methods are
compatible with the methods used by this package. Consumer-only APIs in source-map
are outside this package's contract.
_mappings() is retained as a diagnostic snapshot. Generated-only original fields
are normalized to legacy false; mutations to the returned array are not propagated
to the underlying generator.
Explicit non-goals for 1.x
- No new mapping-name behavior; upstream ignored
mapping.nameand this release does too. - No change to the unusual all-lines column offset behavior.
- No automatic input-size limit; callers own trust-boundary limits.
- No browser global or CDN-specific build.
The package does include a bundler-selected CommonJS browser entry; it does not install a global variable or promise direct script-tag loading.