|
Last change
on this file was 9af201e, checked in by MBK <marija.karapandzova@…>, 2 weeks ago |
|
Fix frontend appearance
|
-
Property mode
set to
100644
|
|
File size:
817 bytes
|
| Line | |
|---|
| 1 | 'use strict';
|
|---|
| 2 |
|
|---|
| 3 | var util = require('./_util');
|
|---|
| 4 |
|
|---|
| 5 | module.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.