mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
core: fix title check
This commit is contained in:
1 parent
e31396468f
commit
56396940fc
2 files changed
+3
-3
No files matched your search
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "hydrooj",
|
"name": "hydrooj",
|
||||||
"version": "3.13.11",
|
"version": "3.13.12",
|
||||||
"bin": "bin/hydrooj.js",
|
"bin": "bin/hydrooj.js",
|
||||||
"main": "src/loader",
|
"main": "src/loader",
|
||||||
"module": "src/loader",
|
"module": "src/loader",
|
||||||
|
|||||||
@@ -59,8 +59,8 @@ export function validate(scheme: any, arg: any) {
|
|||||||
return _validate(scheme, arg, '');
|
return _validate(scheme, arg, '');
|
||||||
}
|
}
|
||||||
|
|
||||||
export const isTitle = (s) => s && s.length < 64;
|
export const isTitle = (s) => typeof s === 'string' && s.trim().length < 64;
|
||||||
export const checkTitle = (s) => { if (!(s && s.length < 64)) throw new ValidationError('title'); else return s; };
|
export const checkTitle = (s) => { if (!(typeof s === 'string' && s.trim().length < 64)) throw new ValidationError('title'); else return s; };
|
||||||
export const isDomainId = (s) => RE_DOMAINID.test(s);
|
export const isDomainId = (s) => RE_DOMAINID.test(s);
|
||||||
export const checkDomainId = (s) => { if (!isDomainId(s)) throw new ValidationError('domainId'); else return s; };
|
export const checkDomainId = (s) => { if (!isDomainId(s)) throw new ValidationError('domainId'); else return s; };
|
||||||
export const isUid = (s) => RE_UID.test(s);
|
export const isUid = (s) => RE_UID.test(s);
|
||||||
|
|||||||
Reference in new issue
Block a user