Skip to content

Commit

Permalink
feat: separated type providers
Browse files Browse the repository at this point in the history
  • Loading branch information
Bram-dc committed Sep 24, 2024
1 parent 375c253 commit b731c74
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
6 changes: 3 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "fastify-type-provider-zod",
"version": "2.1.0",
"description": "Zod Type Provider for Fastify@4",
"description": "Zod Type Provider for Fastify@5",
"main": "dist/index.js",
"types": "dist/index.d.ts",
"files": [
Expand All @@ -19,7 +19,7 @@
"prepublishOnly": "npm run build"
},
"peerDependencies": {
"fastify": "^4.0.0",
"fastify": "^5.0.0",
"zod": "^3.14.2"
},
"repository": {
Expand Down Expand Up @@ -49,7 +49,7 @@
"@vitest/coverage-v8": "^1.6.0",
"eslint": "^8.57.0",
"eslint-plugin-import": "^2.29.1",
"fastify": "^4.27.0",
"fastify": "^5.0.0",
"fastify-plugin": "^5.0.1",
"oas-validator": "^5.0.8",
"openapi-types": "^12.1.3",
Expand Down
3 changes: 2 additions & 1 deletion src/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,8 @@ const defaultSkipList = [
];

export interface ZodTypeProvider extends FastifyTypeProvider {
output: this['input'] extends z.ZodTypeAny ? z.infer<this['input']> : unknown;
validator: this['schema'] extends z.ZodTypeAny ? z.output<this['schema']> : unknown;
serializer: this['schema'] extends z.ZodTypeAny ? z.input<this['schema']> : unknown;
}

interface Schema extends FastifySchema {
Expand Down

0 comments on commit b731c74

Please sign in to comment.