Files
elasticsearch-js/scripts/generate_js_api/templates/duration.param.tmpl
2013-10-03 10:05:58 -07:00

6 lines
247 B
Cheetah

if (_.isNumeric(<%= get %>) || _.isInterval(<%= get %>)) {
<%= set %> = <%= get %>;
} else {
throw new TypeError('Invalid <%= name %>: ' + <%= get %> + ' should be a number or in interval notation (an integer followed by one of Mwdhmsy).');
}