is-date-object (1.1.0)

Published 2026-02-24 13:58:22 +00:00 by atheaadmin

Installation

registry=
npm install is-date-object@1.1.0
"is-date-object": "1.1.0"

About this package

is-date-object Version Badge

github actions coverage dependency status dev dependency status License Downloads

npm badge

Is this value a JS Date object? This module works cross-realm/iframe, and despite ES6 @@toStringTag.

Example

var isDate = require('is-date-object');
var assert = require('assert');

assert.notOk(isDate(undefined));
assert.notOk(isDate(null));
assert.notOk(isDate(false));
assert.notOk(isDate(true));
assert.notOk(isDate(42));
assert.notOk(isDate('foo'));
assert.notOk(isDate(function () {}));
assert.notOk(isDate([]));
assert.notOk(isDate({}));
assert.notOk(isDate(/a/g));
assert.notOk(isDate(new RegExp('a', 'g')));

assert.ok(isDate(new Date()));

Tests

Simply clone the repo, npm install, and run npm test

Dependencies

Dependencies

ID Version
call-bound ^1.0.2
has-tostringtag ^1.0.2

Development Dependencies

ID Version
@arethetypeswrong/cli ^0.17.1
@ljharb/eslint-config ^21.1.1
@ljharb/tsconfig ^0.2.2
@types/core-js ^2.5.8
@types/tape ^5.6.5
auto-changelog ^2.5.0
core-js ^3.39.0
encoding ^0.1.13
eslint =8.8.0
in-publish ^2.0.1
indexof ^0.0.1
is ^3.3.0
npmignore ^0.3.1
nyc ^10.3.2
safe-publish-latest ^2.0.0
tape ^5.9.0
typescript ^5.8.0-dev.20241212

Keywords

Date ES6 toStringTag @@toStringTag Date object
Details
npm
2026-02-24 13:58:22 +00:00
1
Jordan Harband
MIT
latest
8.4 KiB
Assets (1)
Versions (1) View all
1.1.0 2026-02-24