1
0
mirror of https://github.com/thangisme/notes.git synced 2024-11-09 16:17:22 -05:00
notes/node_modules/ajv-keywords/keywords/patternRequired.js
Patrick Marsceill b7b0d0d7bf
Initial commit
2017-03-09 13:16:08 -05:00

25 lines
526 B
JavaScript

'use strict';
module.exports = function defFunc(ajv) {
if (ajv.RULES.keywords.patternRequired)
return console.warn('Keyword patternRequired is already defined');
defFunc.definition = {
type: 'object',
inline: require('./dotjs/patternRequired'),
statements: true,
errors: 'full',
metaSchema: {
type: 'array',
items: {
type: 'string',
format: 'regex'
},
uniqueItems: true
}
};
ajv.addKeyword('patternRequired', defFunc.definition);
return ajv;
};