Commit d9741249 by cherishsince

【优化】中文判断

parent 8f6e6fdb
...@@ -9,5 +9,5 @@ ...@@ -9,5 +9,5 @@
/** 判断字符串是否包含中文 */ /** 判断字符串是否包含中文 */
export const hasChinese = async (str) => { export const hasChinese = async (str) => {
return /[\u4E00-\u9FA5]+/g.test(str) return /[\u4e00-\u9fa5]/.test(str)
} }
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment