Centralize attribute strings in consts and rename "editor:layer" to "editor:layer_path" (#4076)

* Rename "editor:layer" to "editor:layer_path" and centralize it in a const

* Centralize "editor:merged_layers" in a const

* Centralize all other attributes in consts

* Rename consts with ATTR_ prefix

* Format
This commit is contained in:
Keavon Chambers
2026-04-28 21:53:30 -07:00
committed by GitHub
parent 5774ec215d
commit 0847d7b0ab
25 changed files with 306 additions and 254 deletions
+5 -2
View File
@@ -1,5 +1,5 @@
use core_types::Ctx;
use core_types::table::{Table, TableRow};
use core_types::{ATTR_TYPE, Ctx};
use serde_json::Value;
use crate::unescape_string;
@@ -248,7 +248,10 @@ fn query_json_all(
let mut results = Vec::new();
resolve_all(&value, &segments, !unquote_strings, &mut results);
results.into_iter().map(|(text, ty)| TableRow::new_from_element(text).with_attribute("type", ty.to_string())).collect()
results
.into_iter()
.map(|(text, ty)| TableRow::new_from_element(text).with_attribute(ATTR_TYPE, ty.to_string()))
.collect()
}
/// A parsed segment of a JSON access path.