mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-20 01:38:19 +08:00
core: 自动转换pid
This commit is contained in:
1 parent
af345d78de
commit
9b3ceb82de
4 files changed
+10
-6
No files matched your search
@@ -81,6 +81,8 @@ export const checkIntro = (s) => { if (!isIntro()) throw new ValidationError('in
|
||||
export const isDescription = (s: any) => s && s.length < 65536;
|
||||
export const checkDescription = (s) => { if (!(s && s.length < 65536)) throw new ValidationError('description'); else return s; };
|
||||
|
||||
export const parsePid = (s) => (Number.isNaN(+s) ? s : `P${s}`);
|
||||
|
||||
global.Hydro.lib.validator = {
|
||||
validate,
|
||||
isTitle,
|
||||
@@ -105,4 +107,6 @@ global.Hydro.lib.validator = {
|
||||
checkIntro,
|
||||
isDescription,
|
||||
checkDescription,
|
||||
|
||||
parsePid,
|
||||
};
|
||||
Reference in new issue
Block a user