Skip to content

Repository files navigation

PlatformscodecovTests

SourceMapper

Simple Swift implementation of the SourceMap specification: create, load, query, modify, and save source maps.

Examples

letmap=trySourceMap(Data(contentsOf: mapURL))print(map.file)letunpackedMap=tryUnpackedSourceMap(map)letsegment= unpackedMap.map(line:12, column:0)
varmap=SourceMap()
map.sources =[.remote("a.scss")]
map.sourceRoot ="./../src/"try map.set(segments:..., validate:true)letmapData= map.encode()

Documentation

No support for:

  • Extension fields
  • Index map format

Requirements

  • Swift 6.0
  • macOS 14 (tested on macOS 14.6.1 IA64)
  • Linux (tested on Ubuntu 18.04.5)
  • Windows 10, Swift 6.0 (tested in CI only)

Installation

Only with Swift Package Manager, via Xcode or directly:

Package dependency:

.package(name:"SourceMapper",
url:"https://github.com/johnfairh/SourceMapper.git",
from:"3.0.0")

Contributions

Welcome: open an issue / johnfairh@gmail.com / @johnfairh@mastodon.social

License

Distributed under the MIT license.

About

Create and edit Source Maps in Swift

Topics

Resources

Stars

3 stars

Watchers

1 watching

Forks

Releases

Used by

Contributors

Languages