Skip to content

Commit

Permalink
refactor: remove const validation branch (#515)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-tymoshenko authored Aug 31, 2022
1 parent 3ed494f commit ab27c92
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -846,13 +846,6 @@ function buildValue (location, input) {
code += `
json += JSON.stringify(${input})
`
} else if ('const' in schema) {
code += `
if(validator.validate(${JSON.stringify(schema)}, ${input}))
json += '${JSON.stringify(schema.const)}'
else
throw new Error(\`Item $\{JSON.stringify(${input})} does not match schema definition.\`)
`
} else {
code += `
json += JSON.stringify(${input})
Expand Down

0 comments on commit ab27c92

Please sign in to comment.