Files
boc/services/frilans-payout/node_modules/pino-pretty/lib/utils/is-valid-date.js
T

15 lines
337 B
JavaScript
Raw Normal View History

'use strict'
module.exports = isValidDate
/**
* Checks if the argument is a JS Date and not 'Invalid Date'.
*
* @param {Date} date The date to check.
*
* @returns {boolean} true if the argument is a JS Date and not 'Invalid Date'.
*/
function isValidDate (date) {
return date instanceof Date && !Number.isNaN(date.getTime())
}