util-ex
Version:
Browser-friendly enhanced util fully compatible with standard node.js
15 lines (12 loc) • 422 B
JavaScript
import objectToString from '../../object-to-string.mjs';
import isObject from './object.mjs';
const dateClass = '[object Date]';
/**
* Determines whether a value is a date object.
* @param {any} d - The value to check.
* @returns {boolean} - Returns `true` if `d` is a date object, else `false`.
*/
export function isDate(d) {
return isObject(d) && objectToString(d) === dateClass;
};
export default isDate;