0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-01-20 21:32:31 -05:00

refactor(core): replace deprecated .nonempty() with .min(1) for ZodString (#1727)

This commit is contained in:
IceHe.Life 2022-08-03 15:20:34 +08:00 committed by GitHub
parent f257e4deb2
commit 3b7f86e2a2
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 3 deletions

View file

@ -41,8 +41,8 @@ export default function sessionRoutes<T extends AnonymousRouter>(router: T, prov
'/session/sign-in/username-password',
koaGuard({
body: object({
username: string().nonempty(),
password: string().nonempty(),
username: string().min(1),
password: string().min(1),
}),
}),
async (ctx, next) => {

View file

@ -17,7 +17,7 @@ describe('zodTypeToSwagger', () => {
const notStartingWithDigitRegex = /^\D/;
it('nonempty check', () => {
expect(zodTypeToSwagger(string().nonempty())).toEqual({
expect(zodTypeToSwagger(string().min(1))).toEqual({
type: 'string',
minLength: 1,
});