Skip to content

Commit

Permalink
fix: remove allOf conditions
Browse files Browse the repository at this point in the history
  • Loading branch information
leonied7 committed Feb 15, 2022
1 parent e044182 commit efc1140
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 10 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "vjsf",
"version": "0.9.15",
"version": "0.9.16",
"description": "Vue-component capable of building HTML forms out of a JSON schema. A port of react-jsonschema-form",
"main": "dist/vjsf.umd.min.js",
"scripts": {
Expand Down
10 changes: 1 addition & 9 deletions src/components/widgets/CheckboxWidget.vue
Original file line number Diff line number Diff line change
Expand Up @@ -57,14 +57,6 @@ function schemaRequiresTrueValue(schema) {
}
// Check if an enum has a single value of true
if (schema.enum && schema.enum.length === 1 && schema.enum[0] === true) {
return true;
}
// Evaluate each subschema in allOf, to see if one of them requires a true
// value
if (schema.allOf) {
return schema.allOf.some(schemaRequiresTrueValue);
}
return schema.enum && schema.enum.length === 1 && schema.enum[0] === true;
}
</script>

0 comments on commit efc1140

Please sign in to comment.