@technobuddha/library
Version:
A large library of useful functions
13 lines (11 loc) • 408 B
text/typescript
import { isObject } from './is-object.ts';
/**
* Determines whether the provided value is a `Date` object.
* @param value - The value to test.
* @returns `true` if the value is a `Date` object, otherwise `false`.
* @group Object
* @category Type Guards
*/
export function isDate(value: unknown): value is Date {
return isObject(value) && Object.prototype.toString.call(value) === '[object Date]';
}