prohibited.js 673 B

1234567891011121314151617181920212223
  1. "use strict";
  2. Object.defineProperty(exports, "__esModule", { value: true });
  3. function getDef() {
  4. return {
  5. keyword: "prohibited",
  6. type: "object",
  7. schemaType: "array",
  8. macro: function (schema) {
  9. if (schema.length === 0)
  10. return true;
  11. if (schema.length === 1)
  12. return { not: { required: schema } };
  13. return { not: { anyOf: schema.map((p) => ({ required: [p] })) } };
  14. },
  15. metaSchema: {
  16. type: "array",
  17. items: { type: "string" },
  18. },
  19. };
  20. }
  21. exports.default = getDef;
  22. module.exports = getDef;
  23. //# sourceMappingURL=prohibited.js.map