From e0685315b4e605f046b5417d851f752ff31774d1 Mon Sep 17 00:00:00 2001 From: Darren Schroeder <343840+fdncred@users.noreply.github.com> Date: Thu, 19 Dec 2024 17:26:21 -0600 Subject: [PATCH] tweaks to `config flatten` (#14639) # Description @maxim-uvarov found some bugs in the new `config flatten` command. This PR should take care of what's been identified so far. # User-Facing Changes # Tests + Formatting # After Submitting --- crates/nu-utils/src/flatten_json.rs | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/crates/nu-utils/src/flatten_json.rs b/crates/nu-utils/src/flatten_json.rs index ed384db765..2614359faa 100644 --- a/crates/nu-utils/src/flatten_json.rs +++ b/crates/nu-utils/src/flatten_json.rs @@ -236,6 +236,16 @@ impl<'a> JsonFlattener<'a> { if filtered_key.contains(".Bool.val") { filtered_key = filtered_key.replace(".Bool.val", ""); } + if filtered_key.contains(".Truncate.suffix") { + filtered_key = filtered_key.replace(".Truncate.suffix", ".truncating_suffix"); + } + if filtered_key.contains(".RowCount") { + filtered_key = filtered_key.replace(".RowCount", ""); + } + if filtered_key.contains(".Wrap.try_to_keep_words") { + filtered_key = + filtered_key.replace(".Wrap.try_to_keep_words", ".wrapping_try_keep_words"); + } // For now, let's skip replacing these because they tell us which // numbers are closures and blocks which is useful for extracting the content // if filtered_key.contains(".Closure.val") {