'use strict';

var index = require('../../../micromark-util-character@1.2.0/node_modules/micromark-util-character/index.js');

/**
 * @typedef {import('micromark-util-types').Code} Code
 */

/**
 * Classify whether a code represents whitespace, punctuation, or something
 * else.
 *
 * Used for attention (emphasis, strong), whose sequences can open or close
 * based on the class of surrounding characters.
 *
 * > 👉 **Note**: eof (`null`) is seen as whitespace.
 *
 * @param {Code} code
 *   Code.
 * @returns {typeof constants.characterGroupWhitespace | typeof constants.characterGroupPunctuation | undefined}
 *   Group.
 */
function classifyCharacter(code) {
  if (
    code === null ||
    index.markdownLineEndingOrSpace(code) ||
    index.unicodeWhitespace(code)
  ) {
    return 1
  }
  if (index.unicodePunctuation(code)) {
    return 2
  }
}

exports.classifyCharacter = classifyCharacter;
//# sourceMappingURL=index.js.map
