index.d.ts 486 B

123456789101112131415
  1. /**
  2. * Turn the number (in string form as either hexa- or plain decimal) coming from
  3. * a numeric character reference into a character.
  4. *
  5. * Sort of like `String.fromCodePoint(Number.parseInt(value, base))`, but makes
  6. * non-characters and control characters safe.
  7. *
  8. * @param {string} value
  9. * Value to decode.
  10. * @param {number} base
  11. * Numeric base.
  12. * @returns {string}
  13. * Character.
  14. */
  15. export function decodeNumericCharacterReference(value: string, base: number): string;