| 1 |
// problem: not expression is currently returning false on values other than true, false or null |
| 2 |
|
| 3 |
@function truthyfalsey($bool: null) { |
| 4 |
@if not $bool { |
| 5 |
@return falsey; |
| 6 |
} @else { |
| 7 |
@return truthy; |
| 8 |
} |
| 9 |
} |
| 10 |
|
| 11 |
.test { |
| 12 |
debug: truthyfalsey(true); // expect truthy |
| 13 |
debug: truthyfalsey(false); // expect falsey |
| 14 |
debug: truthyfalsey(); // expect falsey (default arg is null) |
| 15 |
debug: truthyfalsey(5); // expect truthy |
| 16 |
debug: truthyfalsey(string); // expect truthy |
| 17 |
debug: truthyfalsey((alpha: 1, bravo: 2)); // expect truthy |
| 18 |
debug: truthyfalsey(this is a list); // expect truthy |
| 19 |
debug: truthyfalsey('true'); // expect truthy |
| 20 |
} |