Sorry, I saw that there are two versions of the function, the second version
works fine.
I have added a check, if only one instance of the key_of_interrest
is included in the Dict,
if this is the case the output is a scalar:
function _retrieve(dict, key_of_interest, output = []) # default value is an empty array
for (key, value) in dict
println("key: ", key, ", typeof(key): ", typeof(key))
if key == key_of_interest
push!(output, value)
end
if value isa AbstractDict
_retrieve(value, key_of_interest, output)
end
end
if size(output)[1] == 1
output = output[]
end
return output
end