fix: Fixes ToBoolean (#1261)

This commit is contained in:
Kamron Batman 2022-11-22 13:12:54 -08:00 committed by GitHub
parent 654f96c44e
commit 645c1949a1
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -807,10 +807,9 @@ public static class Utility
}
public static bool ToBoolean(string value) =>
bool.TryParse(value, out var b) && b ||
value.InsensitiveEquals("enabled") ||
value.InsensitiveEquals("on") ||
!value.InsensitiveEquals("disabled") && !value.InsensitiveEquals("off");
bool.TryParse(value, out var b)
? b
: value.InsensitiveEquals("enabled") || value.InsensitiveEquals("on");
public static double ToDouble(string value)
{