valid-date.js 180 B

12345678
  1. 'use strict';
  2. var isDate = require('./is-date');
  3. module.exports = function (x) {
  4. if (!isDate(x) || isNaN(x)) throw new TypeError(x + " is not valid Date object");
  5. return x;
  6. };