32 lines
742 B
Plaintext
32 lines
742 B
Plaintext
{{# def.definitions }}
|
|
{{# def.errors }}
|
|
{{# def.setup:'format' }}
|
|
|
|
{{
|
|
var $format = it.formats[$schema];
|
|
var $isObject = typeof $format == 'object'
|
|
&& !($format instanceof RegExp)
|
|
&& $format.validate;
|
|
if ($isObject) $format = $format.validate;
|
|
}}
|
|
|
|
{{## def.format:
|
|
formats{{= it.util.getProperty($schema) }}{{? $isObject }}.validate{{?}}
|
|
#}}
|
|
|
|
{{## def.checkFormat:
|
|
{{? typeof $format == 'function' }}
|
|
{{# def.format }}({{=$data}})
|
|
{{??}}
|
|
{{# def.format }}.test({{=$data}})
|
|
{{?}}
|
|
#}}
|
|
|
|
{{? it.opts.format !== false && $format }}
|
|
if (! {{# def.checkFormat }}) {
|
|
{{# def.error:'format' }}
|
|
} {{? $breakOnError }} else { {{?}}
|
|
{{??}}
|
|
{{? $breakOnError }} if (true) { {{?}}
|
|
{{?}}
|