var postcss = require('postcss');

var regex = {
  bType: /^(?!.*(style|width|color|radius|collapse|spacing)).*border.*$/,
  color: /^(?!.*(px|rem|em|%|none)).*$/
};

module.exports = postcss.plugin('postcss-border-shortcut', function (opts) {
  opts = opts || {};
  var type = opts.borderType || 'solid';

  function parseBorder(v, l) {
    var result = '';

    if (l.length === 1 && l[0].match(regex.color)) {
      result = '1px ' + type + ' ' + l[0];
    } else if (l.length === 2) {
      result = l[0] + ' ' + type + ' ' + l[1];
    } else {
      result = v;
    }

    return result;
  }

  function isParsable(d) {
    var value = d.value;
    var valueList = postcss.list.space(value);

    if (valueList[0] !== '0') {
      d.replaceWith(d.prop + ': ' + parseBorder(value, valueList));
    }
  }

  return function (css) {
    css.walkDecls(regex.bType, function (decl) {
      isParsable(decl);
    });
  };
});

@@ -589,24 +589,31 @@
 ult;%0A  %7D%0A%0A  
+return 
 function isP
@@ -613,24 +613,67 @@
 ion 
-isParsable(d
+(css) %7B%0A    css.walkDecls(regex.bType, function (decl
 ) %7B%0A
+  
     
@@ -689,16 +689,19 @@
  = d
+ecl
 .value;%0A
     
@@ -696,16 +696,18 @@
 .value;%0A
+  
     var 
@@ -746,16 +746,18 @@
 alue);%0A%0A
+  
     if (
@@ -786,17 +786,22 @@
 %7B%0A      
-d
+  decl
 .replace
@@ -806,16 +806,19 @@
 ceWith(d
+ecl
 .prop + 
@@ -864,113 +864,11 @@
     
-%7D%0A
   %7D
-%0A%0A  return function (css) %7B%0A    css.walkDecls(regex.bType, function (decl) %7B%0A      isParsable(decl);
 %0A   

remove another function