Crates.io | json-sourcemap |
lib.rs | json-sourcemap |
version | 0.1.2 |
source | src |
created_at | 2023-03-11 07:36:40.008056 |
updated_at | 2023-05-05 08:09:38.003781 |
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 | 21,209 |
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())
}