Skip to content

Commit ab900c8

Browse files
refactor: remove empty schema handler (#519)
1 parent 3c4e084 commit ab900c8

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

index.js

-14
Original file line numberDiff line numberDiff line change
@@ -831,10 +831,6 @@ function buildValue (location, input) {
831831
code += `
832832
else throw new Error(\`The value $\{JSON.stringify(${input})} does not match schema definition.\`)
833833
`
834-
} else if (isEmpty(schema)) {
835-
code += `
836-
json += JSON.stringify(${input})
837-
`
838834
} else {
839835
code += `
840836
json += JSON.stringify(${input})
@@ -925,16 +921,6 @@ function buildValue (location, input) {
925921
return code
926922
}
927923

928-
function isEmpty (schema) {
929-
// eslint-disable-next-line
930-
for (var key in schema) {
931-
if (Object.prototype.hasOwnProperty.call(schema, key) && schema[key] !== undefined) {
932-
return false
933-
}
934-
}
935-
return true
936-
}
937-
938924
module.exports = build
939925

940926
module.exports.validLargeArrayMechanisms = validLargeArrayMechanisms

0 commit comments

Comments
 (0)