Sha256: 65f4f9ff6360b8af6a04f69529fee0c45784cb47048bc17d38d4edc7bf4a954f

Contents?: true

Size: 1.49 KB

Versions: 58

Compression:

Stored size: 1.49 KB

Contents

{{# def.definitions }}
{{# def.errors }}
{{# def.setupKeyword }}
{{# def.setupNextLevel }}


{{## def.validateIf:
  {{# def.setCompositeRule }}
  {{ $it.createErrors = false; }}
  {{# def._validateSwitchRule:if }}
  {{ $it.createErrors = true; }}
  {{# def.resetCompositeRule }}
  {{=$ifPassed}} = {{=$nextValid}};
#}}

{{## def.validateThen:
  {{? typeof $sch.then == 'boolean' }}
    {{? $sch.then === false }}
      {{# def.error:'switch' }}
    {{?}}
    var {{=$nextValid}} = {{= $sch.then }};
  {{??}}
    {{# def._validateSwitchRule:then }}
  {{?}}
#}}

{{## def._validateSwitchRule:_clause:
  {{
    $it.schema = $sch._clause;
    $it.schemaPath = $schemaPath + '[' + $caseIndex + ']._clause';
    $it.errSchemaPath = $errSchemaPath + '/' + $caseIndex + '/_clause';
  }}
  {{# def.insertSubschemaCode }}
#}}

{{## def.switchCase:
  {{? $sch.if && {{# def.nonEmptySchema:$sch.if }} }}
    var {{=$errs}} = errors;
    {{# def.validateIf }}
    if ({{=$ifPassed}}) {
      {{# def.validateThen }}  
    } else {
      {{# def.resetErrors }}
    }
  {{??}}
    {{=$ifPassed}} = true;
    {{# def.validateThen }}
  {{?}}
#}}


{{
  var $ifPassed = 'ifPassed' + it.level
    , $currentBaseId = $it.baseId
    , $shouldContinue;
}}
var {{=$ifPassed}};

{{~ $schema:$sch:$caseIndex }}
  {{? $caseIndex && !$shouldContinue }}
    if (!{{=$ifPassed}}) {
    {{ $closingBraces+= '}'; }}
  {{?}}

  {{# def.switchCase }}
  {{ $shouldContinue = $sch.continue }}
{{~}}

{{= $closingBraces }}

var {{=$valid}} = {{=$nextValid}};

Version data entries

58 entries across 15 versions & 5 rubygems

Version Path
optimacms-0.1.61 spec/dummy/node_modules/ajv-keywords/keywords/dot/switch.jst
disco_app-0.16.1 test/dummy/node_modules/@rails/webpacker/node_modules/ajv-keywords/keywords/dot/switch.jst
disco_app-0.16.1 test/dummy/node_modules/style-loader/node_modules/ajv-keywords/keywords/dot/switch.jst
disco_app-0.16.1 test/dummy/node_modules/css-loader/node_modules/ajv-keywords/keywords/dot/switch.jst
disco_app-0.16.1 test/dummy/node_modules/sass-loader/node_modules/ajv-keywords/keywords/dot/switch.jst
disco_app-0.16.1 test/dummy/node_modules/file-loader/node_modules/ajv-keywords/keywords/dot/switch.jst
disco_app-0.16.1 test/dummy/node_modules/compression-webpack-plugin/node_modules/ajv-keywords/keywords/dot/switch.jst
disco_app-0.16.1 test/dummy/node_modules/babel-loader/node_modules/ajv-keywords/keywords/dot/switch.jst
disco_app-0.15.2 test/dummy/node_modules/style-loader/node_modules/ajv-keywords/keywords/dot/switch.jst
disco_app-0.15.2 test/dummy/node_modules/css-loader/node_modules/ajv-keywords/keywords/dot/switch.jst
disco_app-0.15.2 test/dummy/node_modules/@rails/webpacker/node_modules/ajv-keywords/keywords/dot/switch.jst
disco_app-0.15.2 test/dummy/node_modules/babel-loader/node_modules/ajv-keywords/keywords/dot/switch.jst
disco_app-0.15.2 test/dummy/node_modules/sass-loader/node_modules/ajv-keywords/keywords/dot/switch.jst
disco_app-0.15.2 test/dummy/node_modules/compression-webpack-plugin/node_modules/ajv-keywords/keywords/dot/switch.jst
disco_app-0.15.2 test/dummy/node_modules/file-loader/node_modules/ajv-keywords/keywords/dot/switch.jst
disco_app-0.18.4 test/dummy/node_modules/babel-loader/node_modules/ajv-keywords/keywords/dot/switch.jst
disco_app-0.18.4 test/dummy/node_modules/compression-webpack-plugin/node_modules/ajv-keywords/keywords/dot/switch.jst
disco_app-0.18.4 test/dummy/node_modules/@rails/webpacker/node_modules/ajv-keywords/keywords/dot/switch.jst
disco_app-0.18.4 test/dummy/node_modules/css-loader/node_modules/ajv-keywords/keywords/dot/switch.jst
disco_app-0.18.4 test/dummy/node_modules/file-loader/node_modules/ajv-keywords/keywords/dot/switch.jst