UNPKG

teleform

Version:

Format Telegram messages, escape special characters, switch formatting styles, convert special entities to formatted text and vice versa, form Telegram links, use Unicode symbols.

41 lines (40 loc) 653 B
export { symbol }; const symmap = { '0': '🯰', '1': '🯱', '2': '🯲', '3': '🯳', '4': '🯴', '5': '🯵', '6': '🯶', '7': '🯷', '8': '🯸', '9': '🯹', '8-': '∞', '+': '+', '-': '−', '+-': '±', '*': '×', '/': '÷', '=': '=', '~~': '≈', '>=': '≥', '<=': '≤', '!=': '≠', '.': '·', 'o': '°', 'O': '•', '>_': '🮥', '<': '‹', '>': '›', '<<': '«', '>>': '»', 'h': '‐', 'H': '‑', '--': '–', '---': '—', '...': '…' }; function symbol(code) { return symmap[code] ?? ''; }