Files
elasticsearch-js/scripts/generate/js_api/templates/time.param.tmpl

7 lines
244 B
Cheetah

if (<%= get %> instanceof Date) {
<%= set %> = <%= get %>.getTime();
} else if (_.isNumeric(<%= get %>)) {
<%= set %> = <%= get %>;
} else {
throw new TypeError('Invalid <%= name %>: ' + <%= get %> + ' should be be some sort of time.');
}