Sha256: dfcddd8d11da89a4db062487691f2adb41b524b8062e20ccddad29ca91fb3cdf

Contents?: true

Size: 817 Bytes

Versions: 128

Compression:

Stored size: 817 Bytes

Contents

'use strict';

var util = require('./_util');

module.exports = function defFunc(ajv) {
  if (ajv.RULES.keywords.switch && ajv.RULES.keywords.if) return;

  var metaSchemaRef = util.metaSchemaRef(ajv);

  defFunc.definition = {
    inline: require('./dotjs/switch'),
    statements: true,
    errors: 'full',
    metaSchema: {
      type: 'array',
      items: {
        required: [ 'then' ],
        properties: {
          'if': metaSchemaRef,
          'then': {
            anyOf: [
              { type: 'boolean' },
              metaSchemaRef
            ]
          },
          'continue': { type: 'boolean' }
        },
        additionalProperties: false,
        dependencies: {
          'continue': [ 'if' ]
        }
      }
    }
  };

  ajv.addKeyword('switch', defFunc.definition);
  return ajv;
};

Version data entries

128 entries across 74 versions & 12 rubygems

Version Path
groonga-client-model-6.0.0 test/apps/rails6.1.3/node_modules/ajv-keywords/keywords/switch.js
groonga-client-model-6.0.0 test/apps/rails6.0.3.5/node_modules/ajv-keywords/keywords/switch.js
ruby2js-4.0.4 lib/tasks/testrails/node_modules/ajv-keywords/keywords/switch.js
ruby2js-4.0.3 lib/tasks/testrails/node_modules/ajv-keywords/keywords/switch.js
tang-0.2.0 spec/tang_app/node_modules/ajv-keywords/keywords/switch.js
tang-0.1.0 spec/tang_app/node_modules/ajv-keywords/keywords/switch.js
tang-0.0.9 spec/tang_app/node_modules/ajv-keywords/keywords/switch.js
enju_library-0.3.8 spec/dummy/node_modules/ajv-keywords/keywords/switch.js
jester-data-8.0.0 node_modules/ajv-keywords/keywords/switch.js
ezii-os-5.2.1 node_modules/ajv-keywords/keywords/switch.js
ezii-os-2.0.1 node_modules/ajv-keywords/keywords/switch.js
ezii-os-1.1.0 node_modules/ajv-keywords/keywords/switch.js
ezii-os-1.0.0 node_modules/ajv-keywords/keywords/switch.js
ezii-os-0.0.0.1.0 node_modules/ajv-keywords/keywords/switch.js
ezii-os-0.0.0.0.1 node_modules/ajv-keywords/keywords/switch.js
govuk_publishing_components-18.0.0 node_modules/standard/node_modules/ajv-keywords/keywords/switch.js
govuk_publishing_components-17.21.0 node_modules/standard/node_modules/ajv-keywords/keywords/switch.js
govuk_publishing_components-17.20.0 node_modules/standard/node_modules/ajv-keywords/keywords/switch.js
govuk_publishing_components-17.19.1 node_modules/standard/node_modules/ajv-keywords/keywords/switch.js
govuk_publishing_components-17.19.0 node_modules/standard/node_modules/ajv-keywords/keywords/switch.js