Socket
Socket
Sign inDemoInstall

@fastify/ajv-compiler

Package Overview
Dependencies
Maintainers
8
Versions
17
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@fastify/ajv-compiler - npm Package Compare versions

Comparing version 3.4.0 to 3.5.0

.taprc

6

index.js

@@ -7,3 +7,3 @@ 'use strict'

function ValidatorSelector (opts) {
function AjvCompiler (opts) {
const validatorPool = new Map()

@@ -50,4 +50,6 @@ const serializerPool = new Map()

}
module.exports = ValidatorSelector
module.exports = AjvCompiler
module.exports.default = AjvCompiler
module.exports.AjvCompiler = AjvCompiler
module.exports.AjvReference = AjvReference
module.exports.StandaloneValidator = require('./standalone')
{
"name": "@fastify/ajv-compiler",
"version": "3.4.0",
"version": "3.5.0",
"description": "Build and manage the AJV instances for the fastify framework",
"main": "index.js",
"types": "index.d.ts",
"types": "types/index.d.ts",
"directories": {

@@ -13,3 +13,3 @@ "test": "test"

"lint:fix": "standard --fix",
"unit": "tap test/**/*.test.js",
"unit": "tap",
"test": "npm run unit && npm run test:typescript",

@@ -49,3 +49,3 @@ "posttest": "rimraf test/ajv-generated*.js",

"tap": "^16.2.0",
"tsd": "^0.24.1"
"tsd": "^0.25.0"
},

@@ -56,6 +56,3 @@ "dependencies": {

"fast-uri": "^2.0.0"
},
"tsd": {
"directory": "test/types"
}
}

@@ -244,1 +244,37 @@ 'use strict'

})
t.test('fastify integration within JTD serializer and custom options', async t => {
const factorySerializer = AjvCompiler({ jtdSerializer: true })
const app = fastify({
jsonShorthand: false,
serializerOpts: {
allErrors: true,
logger: 'wrong-value'
},
schemaController: {
compilersFactory: {
buildSerializer: factorySerializer
}
}
})
app.post('/', {
schema: {
response: {
200: {
properties: {
test: { type: 'boolean' }
}
}
}
}
}, async () => { })
try {
await app.ready()
t.fail('should throw')
} catch (error) {
t.equal(error.message, 'logger must implement log, warn and error methods', 'the wrong setting is forwarded to ajv/jtd')
}
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc