AK-21/Graphite-Industrial-Intelligence
0
1import {characterEntities} from 'character-entities'2 3// To do: next major: use `Object.hasOwn`.4const own = {}.hasOwnProperty5 6/**7 * Decode a single character reference (without the `&` or `;`).8 * You probably only need this when you’re building parsers yourself that follow9 * different rules compared to HTML.10 * This is optimized to be tiny in browsers.11 *12 * @param {string} value13 * `notin` (named), `#123` (deci), `#x123` (hexa).14 * @returns {string|false}15 * Decoded reference.16 */17export function decodeNamedCharacterReference(value) {18 return own.call(characterEntities, value) ? characterEntities[value] : false19}20 