Skip to content

Commit

Permalink
refactor: remove empty schema handler (#519)
Browse files Browse the repository at this point in the history
  • Loading branch information
ivan-tymoshenko committed Sep 1, 2022
1 parent 3c4e084 commit ab900c8
Showing 1 changed file with 0 additions and 14 deletions.
14 changes: 0 additions & 14 deletions index.js
Expand Up @@ -831,10 +831,6 @@ function buildValue (location, input) {
code += `
else throw new Error(\`The value $\{JSON.stringify(${input})} does not match schema definition.\`)
`
} else if (isEmpty(schema)) {
code += `
json += JSON.stringify(${input})
`
} else {
code += `
json += JSON.stringify(${input})
Expand Down Expand Up @@ -925,16 +921,6 @@ function buildValue (location, input) {
return code
}

function isEmpty (schema) {
// eslint-disable-next-line
for (var key in schema) {
if (Object.prototype.hasOwnProperty.call(schema, key) && schema[key] !== undefined) {
return false
}
}
return true
}

module.exports = build

module.exports.validLargeArrayMechanisms = validLargeArrayMechanisms
Expand Down

0 comments on commit ab900c8

Please sign in to comment.