michangarrito/apps/whatsapp-service/node_modules/ajv-keywords/src/definitions/prohibited.ts
rckrdmrd 97f407c661 [MIGRATION-V2] feat: Migrar michangarrito a estructura v2
- Prefijo v2: MCH
- TRACEABILITY-MASTER.yml creado
- Listo para integracion como submodulo

Workspace: v2.0.0 | SIMCO: v4.0.0
2026-01-10 11:28:54 -06:00

21 lines
520 B
TypeScript

import type {MacroKeywordDefinition} from "ajv"
export default function getDef(): MacroKeywordDefinition {
return {
keyword: "prohibited",
type: "object",
schemaType: "array",
macro: function (schema: string[]) {
if (schema.length === 0) return true
if (schema.length === 1) return {not: {required: schema}}
return {not: {anyOf: schema.map((p) => ({required: [p]}))}}
},
metaSchema: {
type: "array",
items: {type: "string"},
},
}
}
module.exports = getDef