@fastify/type-provider-typebox
Advanced tools
Comparing version 1.0.0 to 2.0.0
@@ -8,6 +8,1 @@ import { FastifyTypeProvider } from 'fastify' | ||
} | ||
export const ajvTypeBoxPlugin = function (ajv: any): void { | ||
ajv.addKeyword({ keyword: 'kind' }) | ||
ajv.addKeyword({ keyword: 'modifier' }) | ||
} |
{ | ||
"name": "@fastify/type-provider-typebox", | ||
"version": "1.0.0", | ||
"version": "2.0.0", | ||
"description": "A Type Provider for Typebox over Fastify", | ||
@@ -8,3 +8,3 @@ "main": "dist/index.js", | ||
"peerDependencies": { | ||
"@sinclair/typebox": "^0.23.0", | ||
"@sinclair/typebox": "^0.24.1", | ||
"fastify": "^4.0.0" | ||
@@ -14,3 +14,3 @@ }, | ||
"build": "rimraf ./dist && mkdir dist && tsc --outDir dist", | ||
"test": "npm run build && npm run typescript", | ||
"test": "npm run build && npm run typescript && tap tests/index.js", | ||
"typescript": "tsd" | ||
@@ -33,6 +33,8 @@ }, | ||
"devDependencies": { | ||
"@types/node": "^17.0.41", | ||
"@types/node": "^18.0.0", | ||
"fastify": "^4.2.0", | ||
"fastify-tsconfig": "^1.0.1", | ||
"rimraf": "^3.0.2", | ||
"tsd": "^0.20.0" | ||
"tap": "^16.3.0", | ||
"tsd": "^0.21.0" | ||
}, | ||
@@ -39,0 +41,0 @@ "tsd": { |
@@ -20,15 +20,2 @@ # fastify-type-provider-typebox | ||
**Note**: For [ajv] version 7 and above is required to use the `ajvTypeBoxPlugin`: | ||
```ts | ||
import Fastify from 'fastify' | ||
import { ajvTypeBoxPlugin, TypeBoxTypeProvider } from '@fastify/type-provider-typebox' | ||
const fastify = Fastify({ | ||
ajv: { | ||
plugins: [ajvTypeBoxPlugin] | ||
} | ||
}).withTypeProvider<TypeBoxTypeProvider>() | ||
``` | ||
## Example | ||
@@ -35,0 +22,0 @@ |
@@ -1,2 +0,2 @@ | ||
import { TypeBoxTypeProvider, ajvTypeBoxPlugin } from '../index' | ||
import { TypeBoxTypeProvider } from '../index' | ||
import { Type } from '@sinclair/typebox' | ||
@@ -14,3 +14,3 @@ import { expectAssignable, expectType } from 'tsd' | ||
y: Type.Number(), | ||
z: Type.Boolean() | ||
z: Type.Boolean(), | ||
}) | ||
@@ -24,3 +24,2 @@ } | ||
expectAssignable<FastifyInstance>(Fastify({ ajv: { plugins: [ajvTypeBoxPlugin] } })) | ||
expectType<void>(ajvTypeBoxPlugin({ addKeyword: () => {} })) | ||
expectAssignable<FastifyInstance>(Fastify()) |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
7644
11
81
0
6
77