site/node_modules/micromark-util-decode-numeric-character-reference/index.d.ts

16 lines
486 B
TypeScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
/**
* Turn the number (in string form as either hexa- or plain decimal) coming from
* a numeric character reference into a character.
*
* Sort of like `String.fromCodePoint(Number.parseInt(value, base))`, but makes
* non-characters and control characters safe.
*
* @param {string} value
* Value to decode.
* @param {number} base
* Numeric base.
* @returns {string}
* Character.
*/
export function decodeNumericCharacterReference(value: string, base: number): string;