@@ -41,7 +41,7 @@ export default postcss.plugin('postcss-lab-function', opts => {
41
41
}
42
42
}
43
43
44
- if ( isSlash ( slashNode ) ) {
44
+ if ( slashNode && isSlash ( slashNode ) ) {
45
45
slashNode . replaceWith ( newComma ( ) ) ;
46
46
}
47
47
@@ -129,12 +129,12 @@ const alphaUnitMatch = /^%?$/i;
129
129
const calcFuncMatch = / ^ c a l c $ / i;
130
130
const hueUnitMatch = / ^ ( d e g | g r a d | r a d | t u r n ) ? $ / i;
131
131
132
- const isAlphaValue = node => isCalc ( node ) || Object ( node ) . type === 'number' && alphaUnitMatch . test ( node . unit ) ;
133
- const isCalc = node => Object ( node ) . type === 'func' && calcFuncMatch . test ( node . value ) ;
134
- const isHue = node => isCalc ( node ) || Object ( node ) . type === 'number' && hueUnitMatch . test ( node . unit ) ;
135
- const isNumber = node => isCalc ( node ) || Object ( node ) . type === 'number' && node . unit === '' ;
136
- const isPercentage = node => isCalc ( node ) || Object ( node ) . type === 'number' && node . unit === '%' ;
137
- const isSlash = node => Object ( node ) . type === 'operator' && node . value === '/' ;
132
+ const isAlphaValue = node => isCalc ( node ) || node . type === 'number' && alphaUnitMatch . test ( node . unit ) ;
133
+ const isCalc = node => node . type === 'func' && calcFuncMatch . test ( node . value ) ;
134
+ const isHue = node => isCalc ( node ) || node . type === 'number' && hueUnitMatch . test ( node . unit ) ;
135
+ const isNumber = node => isCalc ( node ) || node . type === 'number' && node . unit === '' ;
136
+ const isPercentage = node => isCalc ( node ) || node . type === 'number' && node . unit === '%' ;
137
+ const isSlash = node => node . type === 'operator' && node . value === '/' ;
138
138
const functionalLABMatch = [ isNumber , isNumber , isNumber , isSlash , isAlphaValue ] ;
139
139
const functionalLCHMatch = [ isNumber , isNumber , isHue , isSlash , isAlphaValue ] ;
140
140
const functionalGrayMatch = [ isNumber , isSlash , isAlphaValue ] ;
0 commit comments