fix:修复打包失败的问题

This commit is contained in:
2025-12-16 21:48:58 +08:00
parent ac278aae47
commit 49ff8fd7d6
4 changed files with 23 additions and 2 deletions

View File

@@ -1,7 +1,7 @@
const pattern
= /[a-zA-Z0-9_\u0392-\u03C9\u00C0-\u00FF\u0600-\u06FF\u0400-\u04FF]+|[\u4E00-\u9FFF\u3400-\u4DBF\uF900-\uFAFF\u3040-\u309F\uAC00-\uD7AF]+/g
export function countWord(data: string) {
export const countWord = (data: string)=> {
const m = data.match(pattern)
let count = 0
if (!m) {
@@ -16,4 +16,18 @@ export function countWord(data: string) {
}
}
return count
}
/**
*
*/
export const isMobile = (): boolean => {
if (typeof window === 'undefined') {
return false;
}
const userAgent = navigator.userAgent;
const mobileRegex = /Android|webOS|iPhone|iPad|iPod|BlackBerry|IEMobile|Opera Mini/i;
return mobileRegex.test(userAgent);
}