jshn: introduce json_is_a() convenience function to check field types without using a temporary variable
This commit is contained in:
parent
079549666f
commit
0505bf5f42
1 changed files with 7 additions and 0 deletions
|
@ -244,3 +244,10 @@ json_select() {
|
|||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
json_is_a() {
|
||||
local type
|
||||
|
||||
json_get_type type "$1"
|
||||
[ "$type" = "$2" ]
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue