UNPKG

536 BJavaScriptView Raw
1var env = require('jjv')()
2var schema = require('./schema.json')
3
4env.addSchema('cccf', schema)
5env.addSchema('cccf-multiple', {
6 type : 'array',
7 items : {
8 '$ref' : "#/definitions/cccf"
9 },
10 definitions : {
11 "cccf" : schema
12 }
13})
14
15module.exports = {
16 schema : schema,
17 validate : function(config) {
18 return env.validate('cccf', typeof config == 'object' ? config : JSON.parse(config))
19 },
20 validateMultiple : function(config) {
21 return env.validate('cccf-multiple', typeof config == 'object' ? config : JSON.parse(config))
22 }
23}
\No newline at end of file