| Crates.io | json-sourcemap |
| lib.rs | json-sourcemap |
| version | 0.2.0 |
| created_at | 2023-03-11 07:36:40.008056+00 |
| updated_at | 2025-04-22 10:08:49.492012+00 |
| description | A library for parsing and generating JSON sourcemaps |
| homepage | https://github.com/attila-lin/json-sourcemap-rs |
| repository | https://github.com/attila-lin/json-sourcemap-rs |
| max_upload_size | |
| id | 807076 |
| size | 24,236 |
Just a json-source-map's port to Rust.
Add this to your Cargo.toml:
[dependencies]
json-sourcemap = "0.1"
use json_sourcemap::Options;
// fn main() {
let json = r#"{
"foo": "bar",
"baz": 42
}"#;
let options = Options::default();
let map = json_sourcemap::parse(json, options).unwrap();
println!("{:?}", map);
println!("{:?}", map.get_location("/foo").unwrap());
let locs = map.get_location("/baz").unwrap();
println!("{:?}", locs.key())
// }