Skip to content

Commit

Permalink
fix: correct out of range error
Browse files Browse the repository at this point in the history
  • Loading branch information
markdumay committed Feb 4, 2024
1 parent c915f4f commit 6cda2a8
Showing 1 changed file with 3 additions and 8 deletions.
11 changes: 3 additions & 8 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 }}
{{ 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) (string $val) $def.options.min $def.options.max}}
{{ $error = true }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
{{ end }}
Expand Down

0 comments on commit 6cda2a8

Please sign in to comment.