Sha256: bbdc270891c93a9425d5e487703a1cb050c23f0e94ba36fdd6ecf59951a71cbb
Contents?: true
Size: 553 Bytes
Versions: 59
Compression:
Stored size: 553 Bytes
Contents
'use strict'; module.exports = function defFunc(ajv) { defFunc.definition = { type: 'object', macro: function (schema) { if (schema.length == 0) return {}; if (schema.length == 1) return { not: { required: schema } }; var schemas = schema.map(function (prop) { return { required: [prop] }; }); return { not: { anyOf: schemas } }; }, metaSchema: { type: 'array', items: { type: 'string' } } }; ajv.addKeyword('prohibited', defFunc.definition); return ajv; };
Version data entries
59 entries across 55 versions & 8 rubygems