Download src/common/validators/shared.js from moustafa7/gymco: direct link, hf CLI and curl.
- Browser
- Download file 524 Bytes
-
https://huggingface.co/spaces/moustafa7/gymco/resolve/main/src/common/validators/shared.js
- Command line
-
hf download hf://spaces/moustafa7/gymco/src/common/validators/shared.js
-
curl -L -o shared.js https://huggingface.co/spaces/moustafa7/gymco/resolve/main/src/common/validators/shared.js
524 Bytes
| import { z } from 'zod'; | |
| export const idParam = z.object({ | |
| params: z.object({ | |
| id: z.string().uuid(), | |
| }), | |
| }); | |
| export const listQuery = z.object({ | |
| query: z.object({ | |
| page: z.coerce.number().int().positive().optional(), | |
| limit: z.coerce.number().int().positive().max(100).optional(), | |
| search: z.string().trim().optional(), | |
| }), | |
| }); | |
| export const emptySchema = z.object({ | |
| body: z.object({}).passthrough().optional(), | |
| params: z.object({}).optional(), | |
| query: z.object({}).passthrough().optional(), | |
| }); | |