From 94ae0122abaed9cccca9633b262596c69be394d1 Mon Sep 17 00:00:00 2001 From: ivan-tymoshenko Date: Tue, 30 Aug 2022 21:23:45 +0300 Subject: [PATCH] refactor: remove const validation branch --- index.js | 7 ------- 1 file changed, 7 deletions(-) diff --git a/index.js b/index.js index 4b1dbe80..eca0c929 100644 --- a/index.js +++ b/index.js @@ -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})