File tree Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Expand file tree Collapse file tree 1 file changed +11
-4
lines changed Original file line number Diff line number Diff line change @@ -380,15 +380,22 @@ export class Protofier {
380
380
this . deprotofyCalculationValue ( calculation . arguments [ 0 ] )
381
381
) ;
382
382
case 'clamp' :
383
- if ( calculation . arguments . length !== 3 ) {
383
+ if (
384
+ calculation . arguments . length === 0 ||
385
+ calculation . arguments . length > 3
386
+ ) {
384
387
throw utils . compilerError (
385
- 'Value.Calculation.arguments must have exactly 3 arguments for clamp().'
388
+ 'Value.Calculation.arguments must have 1 to 3 arguments for clamp().'
386
389
) ;
387
390
}
388
391
return SassCalculation . clamp (
389
392
this . deprotofyCalculationValue ( calculation . arguments [ 0 ] ) ,
390
- this . deprotofyCalculationValue ( calculation . arguments [ 1 ] ) ,
391
- this . deprotofyCalculationValue ( calculation . arguments [ 2 ] )
393
+ calculation . arguments . length > 1
394
+ ? this . deprotofyCalculationValue ( calculation . arguments [ 1 ] )
395
+ : undefined ,
396
+ calculation . arguments . length > 2
397
+ ? this . deprotofyCalculationValue ( calculation . arguments [ 2 ] )
398
+ : undefined
392
399
) ;
393
400
case 'min' :
394
401
if ( calculation . arguments . length === 0 ) {
You can’t perform that action at this time.
0 commit comments