[go: nahoru, domu]

tree: 8350f455da9f1df1551eb94ac2b1dc0c17c4c5ea [path history] [tgz]
  1. .github/
  2. test/
  3. .editorconfig
  4. .eslintignore
  5. .eslintrc
  6. .jscs.json
  7. .nycrc
  8. CHANGELOG.md
  9. index.js
  10. LICENSE
  11. package.json
  12. README.md
node_modules/is-date-object/README.md

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