(url: string | null)
| 136 | |
| 137 | class Utils { |
| 138 | static censorUrl(url: string | null): string { |
| 139 | if (!url) return "默认"; |
| 140 | return url.replace(/(?<=\/\/)[^\/]+/, '***'); |
| 141 | } |
| 142 | |
| 143 | static getUtf16Length(text: string): number { |
| 144 | return Buffer.from(text, 'utf16le').length / 2; |