Simple Swift implementation of the SourceMap specification: create, load, query, modify, and save source maps.
let map = try SourceMap(Data(contentsOf: mapURL))
print(map.file)
let unpackedMap = try UnpackedSourceMap(map)
let segment = unpackedMap.map(line: 12, column: 0)
var map = SourceMap()
map.sources = [.remote("a.scss")]
map.sourceRoot = "./../src/"
try map.set(segments: ..., validate: true)
let mapData = map.encode()
No support for:
- Extension fields
- Index map format
- Swift 5.7
- macOS 10.10 (tested on macOS 12.0 IA64)
- Linux (tested on Ubuntu 18.04.5)
- Windows 10, Swift 5.7 (tested in CI only)
Only with Swift Package Manager, via Xcode or directly:
Package dependency:
.package(name: "SourceMapper",
url: "https://github.com/johnfairh/SourceMapper.git",
from: "2.0.0")
Welcome: open an issue / [email protected] / @[email protected]
Distributed under the MIT license.