UNPKG

1.47 kBMarkdownView Raw
1#is-symbol <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 an ES6 Symbol value?
14
15## Example
16
17```js
18var isSymbol = require('is-symbol');
19assert(!isSymbol(function () {}));
20assert(!isSymbol(null));
21assert(!isSymbol(function* () { yield 42; return Infinity; });
22
23assert(isSymbol(Symbol.iterator));
24assert(isSymbol(Symbol('foo')));
25assert(isSymbol(Symbol.for('foo')));
26assert(isSymbol(Object(Symbol('foo'))));
27```
28
29## Tests
30Simply clone the repo, `npm install`, and run `npm test`
31
32[1]: https://npmjs.org/package/is-symbol
33[2]: http://versionbadg.es/ljharb/is-symbol.svg
34[3]: https://travis-ci.org/ljharb/is-symbol.svg
35[4]: https://travis-ci.org/ljharb/is-symbol
36[5]: https://david-dm.org/ljharb/is-symbol.svg
37[6]: https://david-dm.org/ljharb/is-symbol
38[7]: https://david-dm.org/ljharb/is-symbol/dev-status.svg
39[8]: https://david-dm.org/ljharb/is-symbol#info=devDependencies
40[9]: https://ci.testling.com/ljharb/is-symbol.png
41[10]: https://ci.testling.com/ljharb/is-symbol
42[11]: https://nodei.co/npm/is-symbol.png?downloads=true&stars=true
43[license-image]: http://img.shields.io/npm/l/is-symbol.svg
44[license-url]: LICENSE
45[downloads-image]: http://img.shields.io/npm/dm/is-symbol.svg
46[downloads-url]: http://npm-stat.com/charts.html?package=is-symbol