source: trip-planner-front/node_modules/ajv-keywords/keywords/switch.js

Last change on this file was e29cc2e, checked in by Ema <ema_spirova@…>, 3 years ago

primeNG components

  • Property mode set to 100644
File size: 817 bytes
RevLine 
[6a3a178]1'use strict';
2
3var util = require('./_util');
4
5module.exports = function defFunc(ajv) {
6 if (ajv.RULES.keywords.switch && ajv.RULES.keywords.if) return;
7
8 var metaSchemaRef = util.metaSchemaRef(ajv);
9
10 defFunc.definition = {
11 inline: require('./dotjs/switch'),
12 statements: true,
13 errors: 'full',
14 metaSchema: {
15 type: 'array',
16 items: {
17 required: [ 'then' ],
18 properties: {
19 'if': metaSchemaRef,
20 'then': {
21 anyOf: [
22 { type: 'boolean' },
23 metaSchemaRef
24 ]
25 },
26 'continue': { type: 'boolean' }
27 },
28 additionalProperties: false,
29 dependencies: {
30 'continue': [ 'if' ]
31 }
32 }
33 }
34 };
35
36 ajv.addKeyword('switch', defFunc.definition);
37 return ajv;
38};
Note: See TracBrowser for help on using the repository browser.