BVB Source Codes

reactide Show not.js Source code

Return Download reactide: download not.js Source code - Download reactide Source code - Type:.js
  1. 'use strict';
  2. module.exports = function generate_not(it, $keyword) {
  3.   var out = ' ';
  4.   var $lvl = it.level;
  5.   var $dataLvl = it.dataLevel;
  6.   var $schema = it.schema[$keyword];
  7.   var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  8.   var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  9.   var $breakOnError = !it.opts.allErrors;
  10.   var $errorKeyword;
  11.   var $data = 'data' + ($dataLvl || '');
  12.   var $errs = 'errs__' + $lvl;
  13.   var $it = it.util.copy(it);
  14.   $it.level++;
  15.   var $nextValid = 'valid' + $it.level;
  16.   if (it.util.schemaHasRules($schema, it.RULES.all)) {
  17.     $it.schema = $schema;
  18.     $it.schemaPath = $schemaPath;
  19.     $it.errSchemaPath = $errSchemaPath;
  20.     out += ' var ' + ($errs) + ' = errors;  ';
  21.     var $wasComposite = it.compositeRule;
  22.     it.compositeRule = $it.compositeRule = true;
  23.     $it.createErrors = false;
  24.     var $allErrorsOption;
  25.     if ($it.opts.allErrors) {
  26.       $allErrorsOption = $it.opts.allErrors;
  27.       $it.opts.allErrors = false;
  28.     }
  29.     out += ' ' + (it.validate($it)) + ' ';
  30.     $it.createErrors = true;
  31.     if ($allErrorsOption) $it.opts.allErrors = $allErrorsOption;
  32.     it.compositeRule = $it.compositeRule = $wasComposite;
  33.     out += ' if (' + ($nextValid) + ') {   ';
  34.     var $$outStack = $$outStack || [];
  35.     $$outStack.push(out);
  36.     out = ''; /* istanbul ignore else */
  37.     if (it.createErrors !== false) {
  38.       out += ' { keyword: \'' + ($errorKeyword || 'not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
  39.       if (it.opts.messages !== false) {
  40.         out += ' , message: \'should NOT be valid\' ';
  41.       }
  42.       if (it.opts.verbose) {
  43.         out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  44.       }
  45.       out += ' } ';
  46.     } else {
  47.       out += ' {} ';
  48.     }
  49.     var __err = out;
  50.     out = $$outStack.pop();
  51.     if (!it.compositeRule && $breakOnError) { /* istanbul ignore if */
  52.       if (it.async) {
  53.         out += ' throw new ValidationError([' + (__err) + ']); ';
  54.       } else {
  55.         out += ' validate.errors = [' + (__err) + ']; return false; ';
  56.       }
  57.     } else {
  58.       out += ' var err = ' + (__err) + ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  59.     }
  60.     out += ' } else {  errors = ' + ($errs) + '; if (vErrors !== null) { if (' + ($errs) + ') vErrors.length = ' + ($errs) + '; else vErrors = null; } ';
  61.     if (it.opts.allErrors) {
  62.       out += ' } ';
  63.     }
  64.   } else {
  65.     out += '  var err =   '; /* istanbul ignore else */
  66.     if (it.createErrors !== false) {
  67.       out += ' { keyword: \'' + ($errorKeyword || 'not') + '\' , dataPath: (dataPath || \'\') + ' + (it.errorPath) + ' , schemaPath: ' + (it.util.toQuotedString($errSchemaPath)) + ' , params: {} ';
  68.       if (it.opts.messages !== false) {
  69.         out += ' , message: \'should NOT be valid\' ';
  70.       }
  71.       if (it.opts.verbose) {
  72.         out += ' , schema: validate.schema' + ($schemaPath) + ' , parentSchema: validate.schema' + (it.schemaPath) + ' , data: ' + ($data) + ' ';
  73.       }
  74.       out += ' } ';
  75.     } else {
  76.       out += ' {} ';
  77.     }
  78.     out += ';  if (vErrors === null) vErrors = [err]; else vErrors.push(err); errors++; ';
  79.     if ($breakOnError) {
  80.       out += ' if (false) { ';
  81.     }
  82.   }
  83.   return out;
  84. }
  85.  
downloadnot.js Source code - Download reactide Source code
Related Source Codes/Software:
rkt - rkt is a pod-native container engine for Linux. It... 2017-06-11
uWebSockets - Tiny WebSockets https://for... 2017-06-11
realworld - TodoMVC for the RealWorld - Exemplary fullstack Me... 2017-06-11
goreplay - GoReplay is an open-source tool for capturing and ... 2017-06-10
pyenv - Simple Python version management 2017-06-10
postal - 2017-06-11
CRYENGINE - CRYENGINE is a powerful real-time game development... 2017-06-11
reactide - Reactide is the first dedicated IDE for React web ... 2017-06-11
redux-saga - An alternative side effect model for Redux apps ... 2017-06-10
angular-starter - 2017-06-10

 Back to top