SourceMapper
Simple Swift implementation of the SourceMap specification: create, load, query, modify, and save source maps.
Examples
let map = try SourceMap(data: try Data(contentsOf: mapURL))
let segment = map.map(line: 12, column: 0)
let map = SourceMap()
map.sources = [.remote("a.scss")]
map.sourceRoot = "./../src/"
map.setSegments(...)
let mapData = try map.encode()
Documentation
No support for:
- Extension fields
- Index map format
Requirements
- Swift 5.3
- macOS 10.10 (tested on macOS 11.0 IA64)
- Linux (tested on Ubuntu 18.04.5)
Installation
Only with Swift Package Manager, via Xcode or directly:
Package dependency:
.package(name: "SourceMapper",
url: "https://github.com/johnfairh/SourceMapper.git",
from: "1.0.0")
Contributions
Welcome: open an issue / johnfairh@gmail.com / @johnfairh
License
Distributed under the MIT license.