BVB Source Codes

reactide Show allOf.js Source code

Return Download reactide: download allOf.js Source code - Download reactide Source code - Type:.js
  1. 'use strict';
  2. module.exports = function generate_allOf(it, $keyword) {
  3.   var out = ' ';
  4.   var $schema = it.schema[$keyword];
  5.   var $schemaPath = it.schemaPath + it.util.getProperty($keyword);
  6.   var $errSchemaPath = it.errSchemaPath + '/' + $keyword;
  7.   var $breakOnError = !it.opts.allErrors;
  8.   var $it = it.util.copy(it);
  9.   var $closingBraces = '';
  10.   $it.level++;
  11.   var $nextValid = 'valid' + $it.level;
  12.   var $currentBaseId = $it.baseId,
  13.     $allSchemasEmpty = true;
  14.   var arr1 = $schema;
  15.   if (arr1) {
  16.     var $sch, $i = -1,
  17.       l1 = arr1.length - 1;
  18.     while ($i < l1) {
  19.       $sch = arr1[$i += 1];
  20.       if (it.util.schemaHasRules($sch, it.RULES.all)) {
  21.         $allSchemasEmpty = false;
  22.         $it.schema = $sch;
  23.         $it.schemaPath = $schemaPath + '[' + $i + ']';
  24.         $it.errSchemaPath = $errSchemaPath + '/' + $i;
  25.         out += '  ' + (it.validate($it)) + ' ';
  26.         $it.baseId = $currentBaseId;
  27.         if ($breakOnError) {
  28.           out += ' if (' + ($nextValid) + ') { ';
  29.           $closingBraces += '}';
  30.         }
  31.       }
  32.     }
  33.   }
  34.   if ($breakOnError) {
  35.     if ($allSchemasEmpty) {
  36.       out += ' if (true) { ';
  37.     } else {
  38.       out += ' ' + ($closingBraces.slice(0, -1)) + ' ';
  39.     }
  40.   }
  41.   out = it.util.cleanUpCode(out);
  42.   return out;
  43. }
  44.  
downloadallOf.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