Skip to content

Commit d1d2d65

Browse files
committed
fix: Set string does not dispose of child objects when setting
1 parent 20b13c8 commit d1d2d65

File tree

1 file changed

+11
-1
lines changed

1 file changed

+11
-1
lines changed

pkg/lib/traverse.sh

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -84,6 +84,7 @@ bash_object.traverse() {
8484
bash_object.parse_virtual_object "$virtual_item"
8585
local current_object_name="$REPLY1"
8686
local vmd_dtype="$REPLY2"
87+
8788
local -n current_object="$current_object_name"
8889

8990
# If we are not on the last element of the query, then do nothing. We have
@@ -203,7 +204,16 @@ bash_object.traverse() {
203204
local key_value="${current_object["$key"]}"
204205

205206
if [ "${key_value::2}" = $'\x1C\x1D' ]; then
206-
:
207+
virtual_item="${key_value#??}"
208+
209+
bash_object.parse_virtual_object "$virtual_item"
210+
local current_object_name="$REPLY1"
211+
local vmd_dtype="$REPLY2"
212+
213+
local -n current_object="$current_object_name"
214+
215+
# TODO: arrays, objects
216+
current_object["$key"]="$final_value"
207217
else
208218
# TODO: throw error
209219
:

0 commit comments

Comments
 (0)