code: function errorHighlighter(err, options) {
      options = options || {};
      var errColor = colorer(options.errorColor || 'red+bold');
  
      var hasOffset = !(err.offset === undefined || err.offset === null);
      var hasEnd = !(err.endOffset === undefined || err.endOffset === null);
      var within = false;
  
      if (!hasOffset) return null;
      if (hasEnd) {
          return decorateRangedError;
      } else {
          return decorateError;
      }
  
      function decorateRangedError(totalOffset, screenOffset, str) {
          if (totalOffset === err.offset) {
              within = totalOffset !== err.endOffset-1;
              return errColor(stripColor(str));
          } else if (totalOffset === err.endOffset-1) {
              within = false;
              return errColor(stripColor(str));
          } else if (within) {
              return errColor(stripColor(str));
          } else {
              return str;
          }
      }
  
      function decorateError(totalOffset, screenOffset, str) {
          if (totalOffset === err.offset) {
              return errColor(stripColor(str));
          } else {
              return str;
          }
      }
  }
docs: istanbul ignore next