增加判断11位分享码的检查

This commit is contained in:
CounterFire2023 2024-04-22 13:03:10 +08:00
parent b40336efea
commit 641a11eabe

View File

@ -7,7 +7,7 @@ export const isObjectIdString = (str: string) => {
// check if a string is a valid share code
// alphabet:'3fBCM8j17XNA9xYun4wmLWep2oHFlhPcgyEJskqOz6GK0UtV5ZRaDSvrTbidQI'
export const isValidShareCode = (str: string) => {
let reg = new RegExp(`^[${BASE52_ALPHABET}]{10}$`)
let reg = new RegExp(`^[${BASE52_ALPHABET}]{10, 11}$`)
return reg.test(str)
}