code: function getRootFromPattern(pattern, callback) {
    isDirectory(pattern, function (error, data) {
      if (!data) {
        if (glob.hasMagic(pattern)) {
          callback(null, pattern.substring(0, pattern.indexOf("*")));
        } else {
          callback(null, path.dirname(pattern));
        }
      } else {
        callback(null, pattern);
      }
    });
  }
docs: /*
  @function (public) getRootFromPattern {string} [Get root from a pattern] @param pattern {string} @param callback