UNPKG

unicode-to-plain-text

Version:

Convert fancy Unicode text to plain ASCII with smart language preservation

13 lines (12 loc) 409 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.handleUnicodeId = void 0; const handleUnicodeId = (text) => { if (!text.includes(',') || text.split(',').some((number) => isNaN(+number))) return text; return text .split(',') .map((n) => String.fromCharCode(Number(n.trim()))) .join(''); }; exports.handleUnicodeId = handleUnicodeId;