allRequired.js 605 B

123456789101112131415161718192021
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. function getDef() {
  4. return {
  5. keyword: "allRequired",
  6. type: "object",
  7. schemaType: "boolean",
  8. macro(schema, parentSchema) {
  9. if (!schema)
  10. return true;
  11. const required = Object.keys(parentSchema.properties);
  12. if (required.length === 0)
  13. return true;
  14. return { required };
  15. },
  16. dependencies: ["properties"],
  17. };
  18. }
  19. exports.default = getDef;
  20. module.exports = getDef;
  21. //# sourceMappingURL=allRequired.js.map