Skip to content

Commit

Permalink
feat(afterfact): applied comment #1390 (review)
Browse files Browse the repository at this point in the history
  • Loading branch information
hitenkoku committed Aug 12, 2024
1 parent 7b72934 commit 499c3ae
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/afterfact.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1860,6 +1860,10 @@ pub fn output_json_str(
))
&& vec_data.is_empty()
{
if matches!(profile, Profile::Details(_)) && val == "-" {
target.push(format!("{}\"{}\": {{}}", " ".repeat(4), key));
continue;
}
let tmp_val: Vec<&str> = val.split(": ").collect();
let output_val =
_convert_valid_json_str(&tmp_val, matches!(profile, Profile::AllFieldInfo(_)));
Expand Down Expand Up @@ -1907,7 +1911,7 @@ pub fn output_json_str(
HashMap::new();
let mut children_output_order = vec![];
if detect_info.agg_result.is_some() {
if details_target_stock[0] == "-" {
if details_target_stock.is_empty() || details_target_stock[0] == "-" {
output_stock.push(format!("{}\"{}\": {{}}", " ".repeat(4), key));
if jsonl_output_flag {
target.push(output_stock.join(""));
Expand Down

0 comments on commit 499c3ae

Please sign in to comment.