MCPcopy Create free account
hub / github.com/dprint/jsonc-parser / insert_array_element_trailing_commas

Function insert_array_element_trailing_commas

src/cst/mod.rs:3629–3654  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

3627
3628 #[test]
3629 fn insert_array_element_trailing_commas() {
3630 let cst = build_cst(
3631 r#"{
3632 "prop": [
3633 1,
3634 2,
3635 ]
3636}"#,
3637 );
3638 cst
3639 .object_value_or_create()
3640 .unwrap()
3641 .array_value("prop")
3642 .unwrap()
3643 .append(json!(3));
3644 assert_eq!(
3645 cst.to_string(),
3646 r#"{
3647 "prop": [
3648 1,
3649 2,
3650 3,
3651 ]
3652}"#
3653 );
3654 }
3655
3656 #[test]
3657 fn remove_comment() {

Callers

nothing calls this directly

Calls 4

build_cstFunction · 0.85
appendMethod · 0.80
array_valueMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…