1 | var env = require('jjv')()
|
2 | var schema = require('./schema.json')
|
3 |
|
4 | env.addSchema('cccf', schema)
|
5 | env.addSchema('cccf-multiple', {
|
6 | type : 'array',
|
7 | items : {
|
8 | '$ref' : "#/definitions/cccf"
|
9 | },
|
10 | definitions : {
|
11 | "cccf" : schema
|
12 | }
|
13 | })
|
14 |
|
15 | module.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 |