ajv/lib/dot/pattern.jst

9 lines
291 B
Plaintext
Raw Normal View History

{{# def.definitions }}
2015-12-12 16:41:51 +03:00
{{# def.errors }}
{{# def.setup:'pattern' }}
{{ new RegExp($schema); /* test if regexp is valid to fail at compile time rather than in eval */}}
if (! {{= it.usePattern($schema) }}.test({{=$data}}) ) {
{{# def.error:'pattern' }}
} {{? $breakOnError }} else { {{?}}