Skip to content

Commit

Permalink
Fix deprotofy SassCalculation.clamp
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme committed Jul 21, 2023
1 parent 89bd36b commit d8ad75a
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/src/embedded/protofier.dart
Original file line number Diff line number Diff line change
Expand Up @@ -350,16 +350,16 @@ class Protofier {
return SassCalculation.calc(
_deprotofyCalculationValue(calculation.arguments[0]));
} else if (calculation.name == "clamp") {
if (calculation.arguments.length != 3) {
if (calculation.arguments.isEmpty || calculation.arguments.length > 3) {
throw paramsError(
"Value.Calculation.arguments must have exactly 3 arguments for "
"Value.Calculation.arguments must have 1 to 3 arguments for "
"clamp().");
}

return SassCalculation.clamp(
_deprotofyCalculationValue(calculation.arguments[0]),
_deprotofyCalculationValue(calculation.arguments[1]),
_deprotofyCalculationValue(calculation.arguments[2]));
calculation.arguments.length > 1 ? _deprotofyCalculationValue(calculation.arguments[1]) : null,
calculation.arguments.length > 2 ? _deprotofyCalculationValue(calculation.arguments[2]) : null);
} else if (calculation.name == "min") {
if (calculation.arguments.isEmpty) {
throw paramsError(
Expand Down

0 comments on commit d8ad75a

Please sign in to comment.