jshn: add json_get_keys()
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
This commit is contained in:
parent
734d28eb1a
commit
4bc1a3a46b
1 changed files with 9 additions and 0 deletions
|
@ -205,6 +205,15 @@ json_get_type() {
|
|||
eval "export -- \"$__dest=\${$__var}\"; [ -n \"\${$__var+x}\" ]"
|
||||
}
|
||||
|
||||
json_get_keys() {
|
||||
local __dest="$1"
|
||||
local _tbl_cur
|
||||
|
||||
json_get_var _tbl_cur "$2"
|
||||
local __var="${JSON_PREFIX}KEYS_${_tbl_cur}"
|
||||
eval "export -- \"$__dest=\${$__var}\"; [ -n \"\${$__var+x}\" ]"
|
||||
}
|
||||
|
||||
json_get_var() {
|
||||
local __dest="$1"
|
||||
local __cur
|
||||
|
|
Loading…
Reference in a new issue