ianstormtaylor / is-empty

Check whether a value is empty.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Question: should invalid date be considered as empty?

vladholubiev opened this issue · comments

const isEmpty = require('is-empty');

console.log(isEmpty(new Date())); // false;
console.log(isEmpty(new Date('2010-01-01'))); // false
console.log(isEmpty(new Date('invalid date'))); // false as well. Maybe true?

Usually, I used isValid and others when dealing date and time.
IMHO, some invalid objects cannot considered as empty, but the empty objects may be considered as invalid.