forked from indexexchange/nano-interactive-adapter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathnano-interactive-htb-validator.js
41 lines (34 loc) · 1.24 KB
/
nano-interactive-htb-validator.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
'use strict';
////////////////////////////////////////////////////////////////////////////////
// Dependencies ////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
var Inspector = require('../../../libs/external/schema-inspector.js');
////////////////////////////////////////////////////////////////////////////////
// Main ////////////////////////////////////////////////////////////////////////
////////////////////////////////////////////////////////////////////////////////
function partnerValidator(configs) {
var result = Inspector.validate({
type: 'object',
properties: {
xSlots: {
type: 'object',
properties: {
'*': {
type: 'object',
properties: {
pid: {
type: 'string',
minLength: 1
}
}
}
}
}
}
}, configs);
if (!result.valid) {
return result.format();
}
return null;
}
module.exports = partnerValidator;