[improvement] optimize isNaN (#3988)

This commit is contained in:
neverland
2019-07-29 11:32:55 +08:00
committed by GitHub
parent 3299fb6d39
commit 7bcd7e1adc
5 changed files with 52 additions and 30 deletions
+7
View File
@@ -0,0 +1,7 @@
import { isNaN } from './number';
export function isDate(date: Date): boolean {
return (
Object.prototype.toString.call(date) === '[object Date]' && !isNaN(date.getTime())
);
}