You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

33 lines
781 B

4 years ago
  1. {{# def.definitions }}
  2. {{# def.errors }}
  3. {{# def.setupKeyword }}
  4. {{
  5. var $key = 'key' + $lvl
  6. , $idx = 'idx' + $lvl
  7. , $matched = 'patternMatched' + $lvl
  8. , $dataProperties = 'dataProperties' + $lvl
  9. , $closingBraces = ''
  10. , $ownProperties = it.opts.ownProperties;
  11. }}
  12. var {{=$valid}} = true;
  13. {{? $ownProperties }}
  14. var {{=$dataProperties}} = undefined;
  15. {{?}}
  16. {{~ $schema:$pProperty }}
  17. var {{=$matched}} = false;
  18. {{# def.iterateProperties }}
  19. {{=$matched}} = {{= it.usePattern($pProperty) }}.test({{=$key}});
  20. if ({{=$matched}}) break;
  21. }
  22. {{ var $missingPattern = it.util.escapeQuotes($pProperty); }}
  23. if (!{{=$matched}}) {
  24. {{=$valid}} = false;
  25. {{# def.addError:'patternRequired' }}
  26. } {{# def.elseIfValid }}
  27. {{~}}
  28. {{= $closingBraces }}