feat(添加缺失的 checkStrIsUuid):

This commit is contained in:
anime
2025-01-20 13:04:16 +08:00
parent 3310a60fe3
commit 1e21f9dae7

View File

@@ -104,6 +104,17 @@ export function checkStartWithHttp(str) {
}
}
// 检查一个字符串是否UUID https://ihateregex.io/expr/uuid/
export function checkStrIsUuid(str) {
if (!str) {
return false
}
// 使用正则表达式进行匹配
const regex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/
return regex.test(str)
}
// 检查一个字符串是否notionid : 32位仅由数字英文构成
export function checkStrIsNotionId(str) {
if (!str) {