code: function (path) {
              var result = path.match(splitPathRe) || [],
                  root = result[1] || '',
                  dir = result[2] || '';
  
              if (!root && !dir) {
                  // No dirname
                  return '.';
              }
  
              if (dir) {
                  // It has a dirname, strip trailing slash
                  dir = dir.substring(0, dir.length - 1);
              }
  
              return root + dir;
          }
docs: Get dirname of path
  @param {String} path
  @return {String}