Types
Topics
struct SourceMap
struct SourceMap
A source map describing how each segment of a generated file corresponds to some original source file.
The main use cases imagined are:
- Read a source map, make minor modifications, write it back
encode(...)
. - Create a new source map
init(version:)
, fill in fields, and write itencode(...)
. - Read and unpack a source map
UnpackedSourceMap.init(...)
and query itUnpackedSourceMap.map(...)
.
There are two representations of the actual mappings. The mappings
property holds
the compacted mapping string that looks like AAAA;EACA
. This can be decoded into
or written via arrays of Segment
s. These arrays can be very large and time-consuming to create. The
separate UnpackedSourceMap
type works to cache them and satisfy queries.
Declaration
Swift
public struct SourceMap: Hashable, Sendable
extension SourceMap: CustomStringConvertible
struct UnpackedSourceMap
struct UnpackedSourceMap
enum SourceMapError
enum SourceMapError
Error conditions detected by the module.
Declaration
Swift
public enum SourceMapError: Error, CustomStringConvertible