(template, vars, ownPropertiesOnly)
| 2896 | // private funcs |
| 2897 | |
| 2898 | function formatTemplate(template, vars, ownPropertiesOnly) { |
| 2899 | if (!vars) return template; |
| 2900 | return template.replace(/%([^%]+)%/g, function (_, key) { |
| 2901 | var valOrFn; |
| 2902 | if (ownPropertiesOnly) { |
| 2903 | valOrFn = vars.hasOwnProperty(key) ? vars[key] : ''; |
| 2904 | } else { |
| 2905 | valOrFn = vars[key]; |
| 2906 | } |
| 2907 | if (valOrFn != null) { |
| 2908 | if (__isFunction(valOrFn)) { |
| 2909 | return valOrFn(vars); |
| 2910 | } else { |
| 2911 | return valOrFn; |
| 2912 | } |
| 2913 | } else { |
| 2914 | return ""; |
| 2915 | } |
| 2916 | }); |
| 2917 | } |
| 2918 | |
| 2919 | function intRangeValidatorCtor(validatorName, minValue, maxValue, context) { |
| 2920 | var templateExists = (context && context.messageTemplate) || ctor.messageTemplates[validatorName]; |
no test coverage detected