format-basic.js 192 B

123456789
  1. /**
  2. * The smallest way to encode a character.
  3. *
  4. * @param {number} code
  5. * @returns {string}
  6. */
  7. export function formatBasic(code) {
  8. return '&#x' + code.toString(16).toUpperCase() + ';'
  9. }