UNPKG

@daysnap/utils

Version:
20 lines (18 loc) 435 B
// src/toCDB.ts function toCDB(str) { let result = ""; for (let i = 0; i < str.length; i++) { const code = str.charCodeAt(i); if (code >= 65281 && code <= 65374) { result += String.fromCharCode(str.charCodeAt(i) - 65248); } else if (code == 12288) { result += String.fromCharCode(str.charCodeAt(i) - 12288 + 32); } else { result += str.charAt(i); } } return result; } export { toCDB };