jshn: introduce json_is_a() convenience function to check field types without using a temporary variable

This commit is contained in:
Jo-Philipp Wich 2012-12-17 13:54:45 +01:00
parent 079549666f
commit 0505bf5f42

View file

@ -244,3 +244,10 @@ json_select() {
;;
esac
}
json_is_a() {
local type
json_get_type type "$1"
[ "$type" = "$2" ]
}