(count = 1)
| 270 | * @param {number} count |
| 271 | */ |
| 272 | export const generateRandomHanziArray = (count = 1) => { |
| 273 | const minCode = 0x4e00; // 汉字 Unicode 范围的最小值 |
| 274 | const maxCode = 0x9fff; // 汉字 Unicode 范围的最大值 |
| 275 | |
| 276 | const hanziArray = []; |
| 277 | for (let i = 0; i < count; i++) { |
| 278 | const randomCode = random(minCode, maxCode); |
| 279 | hanziArray.push(String.fromCodePoint(randomCode)); |
| 280 | } |
| 281 | |
| 282 | return hanziArray; |
| 283 | }; |
| 284 | |
| 285 | /** @description: 浏览器图标映射 */ |
| 286 | export const BroswerIconMap = (text: string): string | undefined => { |