mirror of
https://github.com/d0zingcat/NotionNext.git
synced 2026-05-13 23:16:47 +00:00
feat(添加缺失的 checkStrIsUuid):
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user