Skip to content

Commit b56f6ee

Browse files
authored
fix: remove merge-deep from the validation (#67)
1 parent baa27b5 commit b56f6ee

File tree

2 files changed

+1
-3
lines changed

2 files changed

+1
-3
lines changed

lib/validate.js

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ const Ajv = require('ajv')
33
const addFormats = require('ajv-formats')
44
const addKeywords = require('ajv-keywords')
55
const httpErrors = require('http-errors')
6-
const merge = require('merge-deep')
76

87
const BASE_REQ_SCHEMA = {
98
type: 'object',
@@ -37,7 +36,7 @@ module.exports = function makeValidatorMiddleware (middleware, schema, opts) {
3736
let validate
3837

3938
function makeValidator () {
40-
const reqSchema = merge({}, BASE_REQ_SCHEMA)
39+
const reqSchema = structuredClone(BASE_REQ_SCHEMA)
4140

4241
// Compile req schema on first request
4342
// Build param validation

package.json

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
"ajv-formats": "^2.1.1",
3434
"ajv-keywords": "^5.1.0",
3535
"http-errors": "^2.0.0",
36-
"merge-deep": "^3.0.3",
3736
"path-to-regexp": "^6.2.1",
3837
"router": "^1.3.8",
3938
"serve-static": "^1.15.0",

0 commit comments

Comments
 (0)