UNPKG

@daysnap/utils

Version:
20 lines (16 loc) 505 B
"use strict";Object.defineProperty(exports, "__esModule", {value: true});// src/toDBC.ts function toDBC(str) { let result = ""; for (let i = 0; i < str.length; i++) { const code = str.charCodeAt(i); if (code >= 33 && code <= 126) { result += String.fromCharCode(str.charCodeAt(i) + 65248); } else if (code == 32) { result += String.fromCharCode(str.charCodeAt(i) + 12288 - 32); } else { result += str.charAt(i); } } return result; } exports.toDBC = toDBC;