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