File tree Expand file tree Collapse file tree 1 file changed +5
-0
lines changed
Expand file tree Collapse file tree 1 file changed +5
-0
lines changed Original file line number Diff line number Diff line change @@ -99,6 +99,8 @@ function arrFilter() {
9999 local -r predicate=$3
100100 shift 3 || traceAndDie " could not shift by 3"
101101
102+ exitIfArgIsNotArray arrFilter_arrIn 1
103+ exitIfArgIsNotArrayOrIsNonEmpty arrFilter_arrOut 2
102104 exitIfArgIsNotFunction " $predicate " 3
103105
104106 local -ri arrFilter_arrInLength=" ${# arrFilter_arrIn[@]} "
@@ -130,6 +132,8 @@ function arrTakeEveryX() {
130132 local -ri offset=$4
131133 shift 4 || traceAndDie " could not shift by 4"
132134
135+ # arrFilter will check that arrFilterMod_arrIn and arrFilterMod_arrOut are arrays and out non empty
136+
133137 # shellcheck disable=SC2317 # is passed by name to arrFilter
134138 function arrFilterMod_fn() {
135139 local -r index=$2
@@ -148,6 +152,7 @@ function arrStringEntryMaxLength() {
148152 fi
149153 local -rn arrStringEntryMaxLength_arr=$1
150154 shift 1 || traceAndDie " could not shift by 1"
155+ exitIfArgIsNotArray arrStringEntryMaxLength
151156
152157 local -i i maxLength=0 arrLength=" ${# arrStringEntryMaxLength_arr[@]} "
153158 for (( i = 0 ; i < arrLength; ++ i)) ; do
You can’t perform that action at this time.
0 commit comments