Skip to content

Commit

Permalink
Explicitly compare count of match
Browse files Browse the repository at this point in the history
Apparently on Windows PowerShell, 0 is not considered "false" but on
PowerShell Core, it is...

Signed-off-by: Gabriel Adrian Samfira <gsamfira@cloudbasesolutions.com>
  • Loading branch information
gabriel-samfira committed Dec 18, 2024
1 parent e36ec25 commit 9ccb746
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion powershell-yaml.psm1
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ function Convert-ValueToProperType {
}
"tag:yaml.org,2002:float" {
$parsedValue = 0.0
if ($infinityRegex.Matches($Node.Value)) {
if ($infinityRegex.Matches($Node.Value).Count -gt 0) {
$prefix = $Node.Value.Substring(0, 1)
switch ($prefix) {
"-" {
Expand Down

0 comments on commit 9ccb746

Please sign in to comment.