@use 'sass:string';

/// Returns whether `$value` is "true", in a more limited sense than the
/// Sass definition of having "truthiness"
///
/// In Sass, all values other than `false` and `null` are considered truthy.
/// Empty strings, empty lists, and empty maps are all "truthy" and sometimes
/// you may want to check if something is more strictly true while excluding
/// such values.
///
/// @param {*} $value - A value to check.
///
/// @return {Bool} Returns `true` if `$value` is true (not just having
/// truthiness).
///
/// @access public
/// @group Utilities
@function is-true($value) {
  @return not not ($value and $value != '' and $value != () and $value != (()) and
      $value != [] and $value != [()] and $value != ([]) and $value != [[]] and
      $value != ('':'') and $value != ('':(())) and $value != ('':[]) and
      $value != ('':([])) and $value != ('':[()]) and $value != ('':[[]]) and
      $value != ('':null));
}
