Open emattias opened 11 months ago
The and helper returns the value as it is if its falsy (rather than converting it to a boolean first) here: https://github.com/jmurphyau/ember-truth-helpers/blob/master/packages/ember-truth-helpers/src/helpers/and.ts#L33
and
This results in some unexpected behavior, see twiddle
Can we change that line to:
return truthConvert(params[i]);
or
return !!params[i];
So that and returns false rather than undefined when it gets undefined. That would result in a more expected behavior IMO.
false
undefined
The
and
helper returns the value as it is if its falsy (rather than converting it to a boolean first) here: https://github.com/jmurphyau/ember-truth-helpers/blob/master/packages/ember-truth-helpers/src/helpers/and.ts#L33This results in some unexpected behavior, see twiddle
Suggestion
Can we change that line to:
or
So that
and
returnsfalse
rather thanundefined
when it getsundefined
. That would result in a more expected behavior IMO.