function toLowerCase (value) {
    return value.toLowerCase();
}

function toUpperCase (value) {
    return value.toUpperCase();
}

export default function applyTransformFeatures (rule, opts) {
    if (rule.type !== 'decl') {
        return;
    }

    // hexadecimal color transformations
    const hexColorRegex = /#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})/g;
    const hasColor = rule.value.match(hexColorRegex) !== null;
    if (hasColor && opts.colorCase) {
        if (opts.colorCase === 'lower') {
            rule.value = rule.value.replace(hexColorRegex, toLowerCase);
        } else if (opts.colorCase === 'upper') {
            rule.value = rule.value.replace(hexColorRegex, toUpperCase);
        }
    }
    if (hasColor && opts.colorShorthand) {
        if (opts.colorShorthand === true) {
            rule.value = rule.value.replace(/#([A-Fa-f0-9])\1([A-Fa-f0-9])\2([A-Fa-f0-9])\3/i, '#$1$2$3');
        } else if (opts.colorShorthand === false) {
            rule.value = rule.value.replace(/^#([A-Fa-f0-9])([A-Fa-f0-9])([A-Fa-f0-9])$/i, '#$1$1$2$2$3$3');
        }
    }

    // zeros transformations
    if (opts.zeroLengthNoUnit && opts.zeroLengthNoUnit === true) {
        rule.value = rule.value.replace(/^0[\.0]*(?:px|r?em|ex|ch|vh|vw|cm|mm|in|pt|pc|vmin|vmax)/g, '0');
    }
    if (opts.trimLeadingZero === true) {
        rule.value = rule.value.replace(/(\D|^)(0)(\.\d+)/g, '$1$3');
    } else if (opts.trimLeadingZero === false) {
        rule.value = rule.value.replace(/(\D|^)(\.\d+)/g, '$10$2');
    }
    if (opts.trimTrailingZeros === true) {
        rule.value = rule.value.replace(/(\d+)(\.[0-9]*[1-9]+)(0+)/g, '$1$2');
        rule.value = rule.value.replace(/(\d+)(\.0+)/g, '$1');
    }
}

@@ -173,20 +173,20 @@
 atures (
-rule
+decl
 , opts) 
@@ -191,63 +191,8 @@
 ) %7B%0A
-    if (rule.type !== 'decl') %7B%0A        return;%0A    %7D%0A%0A
     
@@ -312,20 +312,20 @@
 Color = 
-rule
+decl
 .value.m
@@ -438,36 +438,36 @@
 ) %7B%0A            
-rule
+decl
 .value = rule.va
@@ -451,36 +451,36 @@
    decl.value = 
-rule
+decl
 .value.replace(h
@@ -560,36 +560,36 @@
 ) %7B%0A            
-rule
+decl
 .value = rule.va
@@ -573,36 +573,36 @@
    decl.value = 
-rule
+decl
 .value.replace(h
@@ -736,36 +736,36 @@
 ) %7B%0A            
-rule
+decl
 .value = rule.va
@@ -749,36 +749,36 @@
    decl.value = 
-rule
+decl
 .value.replace(/
@@ -895,36 +895,36 @@
 ) %7B%0A            
-rule
+decl
 .value = rule.va
@@ -908,36 +908,36 @@
    decl.value = 
-rule
+decl
 .value.replace(/
@@ -1113,36 +1113,36 @@
 true) %7B%0A        
-rule
+decl
 .value = rule.va
@@ -1126,36 +1126,36 @@
    decl.value = 
-rule
+decl
 .value.replace(/
@@ -1267,36 +1267,36 @@
 true) %7B%0A        
-rule
+decl
 .value = rule.va
@@ -1280,36 +1280,36 @@
    decl.value = 
-rule
+decl
 .value.replace(/
@@ -1386,36 +1386,36 @@
 alse) %7B%0A        
-rule
+decl
 .value = rule.va
@@ -1399,36 +1399,36 @@
    decl.value = 
-rule
+decl
 .value.replace(/
@@ -1503,36 +1503,36 @@
 true) %7B%0A        
-rule
+decl
 .value = rule.va
@@ -1516,36 +1516,36 @@
    decl.value = 
-rule
+decl
 .value.replace(/
@@ -1590,20 +1590,20 @@
         
-rule
+decl
 .value =
@@ -1607,12 +1607,12 @@
 e = 
-rule
+decl
 .val

Remove dead branch, clarify usage.