sensordb2 e64a8defe5 3.17 | 1 éve | |
---|---|---|
.. | ||
.github | 1 éve | |
test | 1 éve | |
.editorconfig | 1 éve | |
.eslintignore | 1 éve | |
.eslintrc | 1 éve | |
.jscs.json | 1 éve | |
.nycrc | 1 éve | |
CHANGELOG.md | 1 éve | |
LICENSE | 1 éve | |
README.md | 1 éve | |
index.js | 1 éve | |
package.json | 1 éve |
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