パッケージの詳細

is-date-object

inspect-js172.1mMIT1.1.0

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

Date, ES6, toStringTag, @@toStringTag

readme

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

更新履歴

Changelog

All notable changes to this project will be documented in this file.

The format is based on Keep a Changelog and this project adheres to Semantic Versioning.

v1.1.0 - 2024-12-12

Commits

  • [actions] reuse common workflows 35c5af0
  • [meta] use npmignore to autogenerate an npmignore file db6113c
  • [New] add types 4f1d9b3
  • [actions] split out node 10-20, and 20+ c9a1e4f
  • [Dev Deps] update eslint, @ljharb/eslint-config, core-js, safe-publish-latest, tape 35a2864
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, tape b670bca
  • [actions] update rebase action to use reusable workflow d6bb341
  • [actions] update codecov uploader f850678
  • [Robustness] use call-bound 18ed326
  • [Dev Deps] update @ljharb/eslint-config, auto-changelog, core-js, npmignore, tape f0e792f
  • [meta] add exports field 342351f
  • [Tests] replace aud with npm audit 9b9b9cf
  • [Deps] update has-tostringtag 1bc37ab
  • [meta] add sideEffects flag 86d3a16
  • [Dev Deps] add missing peer dep fee274d

v1.0.5 - 2021-08-05

Commits

  • [meta] remove .jscs.json 31c731c
  • [Fix] use has-tostringtag to behave correctly in the presence of symbol shams 17a6df4
  • [Dev Deps] update eslint, auto-changelog, tape 79db3af

v1.0.4 - 2021-05-07

Commits

  • [Fix] do not use Object.prototype.toString when Symbol.toStringTag is shammed 8943a4a
  • [readme] make all URLs https 1d4d6cd
  • [Dev Deps] update eslint a7abeaa

v1.0.3 - 2021-05-05

Commits

  • [Tests] migrate tests to Github Actions 023504f
  • [readme] add actions and codecov badges e63305f
  • [meta] do not publish github action workflow files 017d906
  • [Tests] run nyc on all tests 0376b6f
  • [readme] fix repo URLs; remove defunct badges 1c148c6
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog, tape c7a3f54
  • [actions] add "Allow Edits" workflow e79b5b2
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, tape da28980
  • [Dev Deps] update eslint, @ljharb/eslint-config, aud, auto-changelog 5cabae9
  • [readme] add actions and codecov badges 33dfb88
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape 745eb04
  • [Dev Deps] update eslint, @ljharb/eslint-config, tape 466c62b
  • [actions] use checkout v2; remove unneeded env ff87a16
  • [Dev Deps] update auto-changelog, tape 93188f5
  • [meta] use prepublishOnly script for npm 7+ 1d0e3ea
  • [actions] update workflows 4d1a235
  • [Dev Deps] update auto-changelog; add aud 67be59a
  • [actions] switch Automatic Rebase workflow to pull_request_target event a6661c2
  • [Tests] only audit prod deps dd4a47f

v1.0.2 - 2019-12-18

Commits

  • [Tests] use shared travis-ci configs 8a378b8
  • [Tests] on all node minors; use nvm install-latest-npm; fix scripts; improve matrix 6e97a21
  • [Dev Deps] update eslint, @ljharb/eslint-config, is, jscs, nsp, semver, tape 8472b90
  • [Tests] up to node v10.0, v9.11, v8.11, v6.14, v4.9 ae73e38
  • [meta] add auto-changelog 82f8f47
  • [meta] remove unused Makefile and associated utilities 788a2cd
  • [Tests] up to node v11.4, v10.14, v8.14, v6.15 b9caf7c
  • [Tests] up to node v12.4, v11.15, v10.15, v8.15, v6.17; use nvm install-latest-npm cda0abc
  • [Tests] up to node v12.10, v10.16, v8.16 49bc482
  • [Dev Deps] update eslint, @ljharb/eslint-config, semver, tape; add safe-publish-latest f77fec4
  • [actions] add automatic rebasing / merge commit blocking 68605fc
  • [meta] create FUNDING.yml 4f82d88
  • [Dev Deps] update tape, jscs, eslint, @ljharb/eslint-config 3cbf28a
  • [Dev Deps] update eslint, @ljharb/eslint-config@, is, semver, tape abf9fb0
  • [Tests] switch from nsp to npm audit 6543c7d
  • [Dev Deps] update eslint, @ljharb/eslint-config, covert, tape ba5d2d7
  • [Dev Deps] update eslint, nsp, semver, tape c1e3525
  • [Tests] use npx aud instead of nsp or npm audit with hoops 14e4824
  • [Dev Deps] update eslint, @ljharb/eslint-config, safe-publish-latest 68ead64
  • [Dev Deps] update eslint, semver,tape,semver[f55453f`](https://github.com/inspect-js/is-date-object/commit/f55453f200903277465d7e9307a9c49120a4f419)
  • Only apps should have lockfiles 6c848eb
  • [Tests] remove jscs 3fd3a62
  • [Dev Deps] update eslint, tape 77d3130
  • [meta] add funding field 9ef6d58

v1.0.1 - 2015-09-27

Commits

  • Update tape, semver, eslint; use my personal shared eslint config. 731aa13
  • Update is, tape, covert, jscs, editorconfig-tools, nsp, eslint, semver 53e43a6
  • Update eslint d2fc304
  • Update tape, jscs, eslint, @ljharb/eslint-config c9568df
  • Test on latest node and io.js versions. a21d537
  • Update nsp, eslint, semver 9e1d908
  • Update covert, jscs, eslint, semver f198f6b
  • [Dev Deps] update tape, jscs, eslint ab9bdbb
  • If @@toStringTag is not present, use the old-school Object#toString test. c03afce
  • [Dev Deps] update jscs, nsp, tape, eslint, @ljharb/eslint-config 9d94ccb
  • [Dev Deps] update is, eslint, @ljharb/eslint-config, semver 35cbff7
  • Test up to io.js v2.3 be5d11e
  • [Tests] on io.js v3.3, up to node v4.1 20221a3
  • [Tests] up to io.js v3.2 7009b4a
  • Test on io.js v2.1 68b29b1
  • Remove editorconfig-tools 8d3972c
  • [Dev Deps] update tape 204945d
  • Switch from vb.teelaun.ch to versionbadg.es for the npm version badge SVG. 7bff214
  • Test on io.js v2.5 92f7bd6
  • Test on io.js v2.4 ebb34bf
  • Fix tests for faked @@toStringTag 3b9c26c
  • Test on io.js v3.0 5eedf4b

v1.0.0 - 2015-01-28

Commits