router 更新

This commit is contained in:
2025-03-02 16:51:07 +08:00
parent bac3e5b393
commit ba7e00bd7a
4 changed files with 54 additions and 15 deletions

View File

@@ -0,0 +1,14 @@
import { createSchema } from '@kevisual/router';
const a = createSchema({
type: 'string',
minLength: 1,
maxLength: 10,
regex: '^[a-zA-Z0-9_]+$',
required: false,
});
console.log(a.safeParse('1234567890'));
console.log(a.safeParse('').error);
console.log(a.safeParse(undefined));
console.log(a.safeParse(null).error);