UNPKG

es-toolkit

Version:

A state-of-the-art, high-performance JavaScript utility library with a small bundle size and strong type annotations.

20 lines (19 loc) 440 B
//#region src/predicate/isDate.ts /** * Checks if `value` is a Date object. * * @param value The value to check. * @returns Returns `true` if `value` is a Date object, `false` otherwise. * * @example * const value1 = new Date(); * const value2 = '2024-01-01'; * * console.log(isDate(value1)); // true * console.log(isDate(value2)); // false */ function isDate(value) { return value instanceof Date; } //#endregion exports.isDate = isDate;