Projekt

Obecné

Profil

Stáhnout (1.71 KB) Statistiky
| Větev: | Revize:
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

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

    
15
## Example
16

    
17
```js
18
var isDate = require('is-date-object');
19
var assert = require('assert');
20

    
21
assert.notOk(isDate(undefined));
22
assert.notOk(isDate(null));
23
assert.notOk(isDate(false));
24
assert.notOk(isDate(true));
25
assert.notOk(isDate(42));
26
assert.notOk(isDate('foo'));
27
assert.notOk(isDate(function () {}));
28
assert.notOk(isDate([]));
29
assert.notOk(isDate({}));
30
assert.notOk(isDate(/a/g));
31
assert.notOk(isDate(new RegExp('a', 'g')));
32

    
33
assert.ok(isDate(new Date()));
34
```
35

    
36
## Tests
37
Simply 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
(5-5/7)