site/node_modules/stringify-entities/lib/util/format-basic.js

10 lines
192 B
JavaScript
Raw Permalink Normal View History

2024-10-14 06:09:33 +00:00
/**
* The smallest way to encode a character.
*
* @param {number} code
* @returns {string}
*/
export function formatBasic(code) {
return '&#x' + code.toString(16).toUpperCase() + ';'
}