Skip to content

Commit

Permalink
fix: indicate required properties (#77)
Browse files Browse the repository at this point in the history
  • Loading branch information
magicmatatjahu authored Mar 17, 2021
1 parent d6bfeb8 commit e7e2d86
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion components/Schema.js
Original file line number Diff line number Diff line change
Expand Up @@ -127,5 +127,7 @@ function buildPath(path = '', field = '') {
}

function isRequired(obj, key) {
return obj && Array.isArray(obj.required) && !!(obj.required.includes(key));
if (!obj || typeof obj.required !== 'function') return false;
const required = obj.required() || [];
return required.includes(key);
}

0 comments on commit e7e2d86

Please sign in to comment.