Skip to content

Commit

Permalink
refactor: remove const validation branch
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-tymoshenko committed Aug 31, 2022
1 parent 3ed494f commit 94ae012
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 94ae012

Please sign in to comment.