(pat: string)
| 60 | } |
| 61 | |
| 62 | function validateProperties(pat: string): void { |
| 63 | gen.forIn("key", data, (key) => { |
| 64 | gen.if(_`${usePattern(cxt, pat)}.test(${key})`, () => { |
| 65 | const alwaysValid = alwaysValidPatterns.includes(pat) |
| 66 | if (!alwaysValid) { |
| 67 | cxt.subschema( |
| 68 | { |
| 69 | keyword: "patternProperties", |
| 70 | schemaProp: pat, |
| 71 | dataProp: key, |
| 72 | dataPropType: Type.Str, |
| 73 | }, |
| 74 | valid |
| 75 | ) |
| 76 | } |
| 77 | |
| 78 | if (it.opts.unevaluated && props !== true) { |
| 79 | gen.assign(_`${props}[${key}]`, true) |
| 80 | } else if (!alwaysValid && !it.allErrors) { |
| 81 | // can short-circuit if `unevaluatedProperties` is not supported (opts.next === false) |
| 82 | // or if all properties were evaluated (props === true) |
| 83 | gen.if(not(valid), () => gen.break()) |
| 84 | } |
| 85 | }) |
| 86 | }) |
| 87 | } |
| 88 | }, |
| 89 | } |
| 90 |
no test coverage detected
searching dependent graphs…