File tree Expand file tree Collapse file tree 1 file changed +8
-1
lines changed
Expand file tree Collapse file tree 1 file changed +8
-1
lines changed Original file line number Diff line number Diff line change @@ -271,7 +271,13 @@ has_key() {
271271
272272check_eq () {
273273 tput cuf 6
274- local check=$( jq --argjson a " $1 " --argjson b " $2 " -n ' def post_recurse(f): def r: (f | select(. != null) | r), .; r; def post_recurse: post_recurse(.[]?); ($a | (post_recurse | arrays) |= sort) as $a | ($b | (post_recurse | arrays) |= sort) as $b | $a == $b' )
274+ local type=$( jq -r --argjson a " $1 " -n ' $a|type' )
275+ local check
276+ if [[ $type == " object" || $type == " array" ]]; then
277+ check=$( jq --argjson a " $1 " --argjson b " $2 " -n ' def post_recurse(f): def r: (f | select(. != null) | r), .; r; def post_recurse: post_recurse(.[]?); ($a | (post_recurse | arrays) |= sort) as $a | ($b | (post_recurse | arrays) |= sort) as $b | $a == $b' )
278+ else
279+ check=$( jq --argjson a " $1 " --argjson b " $2 " -n ' $a == $b' )
280+ fi
275281 if [[ $check == " true" ]]; then
276282 echo " ${GREEN}${BOLD} Check Passed${RESET} "
277283 else
@@ -284,6 +290,7 @@ check_eq() {
284290 fi
285291}
286292
293+
287294run () {
288295 for arg in " $@ " ; do
289296 case $arg in
You can’t perform that action at this time.
0 commit comments