import { characterEntities } from '../../../character-entities@2.0.2/node_modules/character-entities/index.mjs';

// To do: next major: use `Object.hasOwn`.
const own = {}.hasOwnProperty;

/**
 * Decode a single character reference (without the `&` or `;`).
 * You probably only need this when you’re building parsers yourself that follow
 * different rules compared to HTML.
 * This is optimized to be tiny in browsers.
 *
 * @param {string} value
 *   `notin` (named), `#123` (deci), `#x123` (hexa).
 * @returns {string|false}
 *   Decoded reference.
 */
function decodeNamedCharacterReference(value) {
  return own.call(characterEntities, value) ? characterEntities[value] : false
}

export { decodeNamedCharacterReference };
//# sourceMappingURL=index.mjs.map
