吕君喜 406d880ac6 first | 3 rokov pred | |
---|---|---|
.. | ||
.eslintrc | 3 rokov pred | |
.jscs.json | 3 rokov pred | |
.npmignore | 3 rokov pred | |
.travis.yml | 3 rokov pred | |
CHANGELOG.md | 3 rokov pred | |
LICENSE | 3 rokov pred | |
Makefile | 3 rokov pred | |
README.md | 3 rokov pred | |
index.js | 3 rokov pred | |
package.json | 3 rokov pred | |
test.js | 3 rokov pred |
Is this value a JS Date object? This module works cross-realm/iframe, and despite ES6 @@toStringTag.
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()));
Simply clone the repo, npm install
, and run npm test