extensions/bool/bool_extensions library

Utility extensions for working with nullable and non-nullable boolean values.

These extensions provide a consistent API for:

  • Null-safe boolean validation.
  • Boolean state checks.
  • Integer conversion.
  • Boolean toggling.

The nullable extension delegates most operations to the non-nullable extension after resolving a null value through validate(), ensuring consistent behavior across both implementations.

Extensions

BooleanExtensions on bool
Extensions for non-nullable bool values.
BooleanOrNullExtensions on bool?
Extensions for nullable bool values.