code: function doesStateMatchGlob (glob) {
      var globSegments = glob.split('.'),
          segments = $state.$current.name.split('.');
  
      //match greedy starts
      if (globSegments[0] === '**') {
         segments = segments.slice(indexOf(segments, globSegments[1]));
         segments.unshift('**');
      }
      //match greedy ends
      if (globSegments[globSegments.length - 1] === '**') {
         segments.splice(indexOf(segments, globSegments[globSegments.length - 2]) + 1, Number.MAX_VALUE);
         segments.push('**');
      }
  
      if (globSegments.length != segments.length) {
        return false;
      }
  
      //match single stars
      for (var i = 0, l = globSegments.length; i < l; i++) {
        if (globSegments[i] === '*') {
          segments[i] = '*';
        }
      }
  
      return segments.join('') === globSegments.join('');
    }
docs: Returns true if glob matches current $state name.