File tree Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Expand file tree Collapse file tree 1 file changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -87,10 +87,9 @@ const allFunctions = [
8787const vendorPrefixes = [ '-webkit-' , '-moz-' , '-ms-' , '-o-' ] ;
8888const reFunctions = new RegExp ( `^(${ vendorPrefixes . join ( '|' ) } )?(${ allFunctions . join ( '|' ) } )` , 'i' ) ;
8989const rePunctuation = new RegExp ( `^(\\${ Punctuation . chars . join ( '|\\' ) } )` ) ;
90-
91- const colorFunctionsRegex = / ^ ( h s l a ? | h w b | l a b | l c h | r g b a ? ) $ / i;
92- const varFunctionRegex = / ^ v a r $ / i;
93- const varPrefixRegex = / ^ - - [ ^ \s ] + $ / ;
90+ const reColorFunctions = / ^ ( h s l a ? | h w b | l a b | l c h | r g b a ? ) $ / i;
91+ const reVar = / ^ v a r $ / i;
92+ const reVarPrefix = / ^ - - [ ^ \s ] + $ / ;
9493
9594class Func extends Container {
9695 constructor ( options = { } ) {
@@ -192,9 +191,8 @@ class Func extends Container {
192191
193192 const { lastNode } = parser ;
194193 const { nodes } = node ;
195- lastNode . isColor = colorFunctionsRegex . test ( lastNode . name ) ;
196- lastNode . isVar =
197- varFunctionRegex . test ( lastNode . name ) && nodes . length && varPrefixRegex . test ( nodes [ 0 ] . value ) ;
194+ lastNode . isColor = reColorFunctions . test ( lastNode . name ) ;
195+ lastNode . isVar = reVar . test ( lastNode . name ) && nodes . length && reVarPrefix . test ( nodes [ 0 ] . value ) ;
198196 }
199197}
200198
You can’t perform that action at this time.
0 commit comments