Skip to content

Commit

Permalink
Merge pull request #9 from gethinode/develop
Browse files Browse the repository at this point in the history
Correct out of range error
  • Loading branch information
markdumay authored Feb 4, 2024
2 parents 404e8af + 506969b commit 20d4daa
Showing 1 changed file with 4 additions and 9 deletions.
13 changes: 4 additions & 9 deletions layouts/partials/utilities/IsInvalidArgs.html
Original file line number Diff line number Diff line change
Expand Up @@ -102,16 +102,11 @@
{{ warnf "[%s] argument '%s': unexpected value '%s'" $structure (string $key) $val }}
{{ $error = true }}
{{ end }}
{{ else if and $def.options.min (in (slice "int" "float" "float64") $actual) }}
{{ if lt $val $def.options.min }}
{{ warnf "[%s] argument '%s': value '%s' out of range [$d, $d]" $structure (string $key) $val $def.options.min $def.options.max}}
{{ else if and (or $def.options.min $def.options.max) (in (slice "int" "float" "float64") $actual) }}
{{ if or (lt $val $def.options.min) (gt $val $def.options.max) }}
{{ warnf "[%s] argument '%s': value '%s' out of range [%d, %d]" $structure (string $key) (string $val) $def.options.min $def.options.max}}
{{ $error = true }}
{{ end }}
{{ else if and $def.options.max (in (slice "int" "float" "float64") $actual) }}
{{ if (gt $val $def.options.max) }}
{{ warnf "[%s] argument '%s': value '%s' out of range [$d, $d]" $structure (string $key) $val $def.options.min $def.options.max}}
{{ $error = true }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
Expand Down

0 comments on commit 20d4daa

Please sign in to comment.