This commit is contained in:
Sebastian
2024-09-24 09:15:32 +02:00
parent 75d06ef967
commit 7b0df6cbf8

View File

@@ -13,7 +13,7 @@ JSON_FILE="$BASEPATH/reference-rpc-endpoint.json"
# Function to extract values for a given key
extract_values() {
local key=$1
cat "$JSON_FILE" | jq -r --arg key "$key" '.[$key] | .default? // .archive? // [] | .[]'
cat "$JSON_FILE" | jq -r --arg key "$key" '.[$key] | if .default then .default[] else [] end, if .archive then .archive[] else [] end'
}
# Initialize an empty result string