Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | - | - | ||||
.jscs.json | D | 12-May-2024 | 2.8 KiB | 123 | 81 | |
.npmignore | D | 12-May-2024 | 587 | 29 | 21 | |
.travis.yml | D | 12-May-2024 | 1.1 KiB | 59 | 58 | |
CHANGELOG.md | D | 12-May-2024 | 421 | 11 | 9 | |
LICENSE | D | 12-May-2024 | 1.1 KiB | 23 | 17 | |
Makefile | D | 12-May-2024 | 3.7 KiB | 62 | 40 | |
README.md | D | 12-May-2024 | 1.7 KiB | 54 | 43 | |
index.js | D | 12-May-2024 | 551 | 21 | 17 | |
package.json | D | 12-May-2024 | 1.6 KiB | 66 | 65 | |
test.js | D | 12-May-2024 | 1.2 KiB | 34 | 29 |
README.md
1# is-date-object <sup>[![Version Badge][2]][1]</sup> 2 3[![Build Status][3]][4] 4[![dependency status][5]][6] 5[![dev dependency status][7]][8] 6[![License][license-image]][license-url] 7[![Downloads][downloads-image]][downloads-url] 8 9[![npm badge][11]][1] 10 11[![browser support][9]][10] 12 13Is this value a JS Date object? This module works cross-realm/iframe, and despite ES6 @@toStringTag. 14 15## Example 16 17```js 18var isDate = require('is-date-object'); 19var assert = require('assert'); 20 21assert.notOk(isDate(undefined)); 22assert.notOk(isDate(null)); 23assert.notOk(isDate(false)); 24assert.notOk(isDate(true)); 25assert.notOk(isDate(42)); 26assert.notOk(isDate('foo')); 27assert.notOk(isDate(function () {})); 28assert.notOk(isDate([])); 29assert.notOk(isDate({})); 30assert.notOk(isDate(/a/g)); 31assert.notOk(isDate(new RegExp('a', 'g'))); 32 33assert.ok(isDate(new Date())); 34``` 35 36## Tests 37Simply clone the repo, `npm install`, and run `npm test` 38 39[1]: https://npmjs.org/package/is-date-object 40[2]: http://versionbadg.es/ljharb/is-date-object.svg 41[3]: https://travis-ci.org/ljharb/is-date-object.svg 42[4]: https://travis-ci.org/ljharb/is-date-object 43[5]: https://david-dm.org/ljharb/is-date-object.svg 44[6]: https://david-dm.org/ljharb/is-date-object 45[7]: https://david-dm.org/ljharb/is-date-object/dev-status.svg 46[8]: https://david-dm.org/ljharb/is-date-object#info=devDependencies 47[9]: https://ci.testling.com/ljharb/is-date-object.png 48[10]: https://ci.testling.com/ljharb/is-date-object 49[11]: https://nodei.co/npm/is-date-object.png?downloads=true&stars=true 50[license-image]: http://img.shields.io/npm/l/is-date-object.svg 51[license-url]: LICENSE 52[downloads-image]: http://img.shields.io/npm/dm/is-date-object.svg 53[downloads-url]: http://npm-stat.com/charts.html?package=is-date-object 54