[d565449] | 1 | # is-symbol <sup>[![Version Badge][2]][1]</sup>
|
---|
| 2 |
|
---|
| 3 | [![github actions][actions-image]][actions-url]
|
---|
| 4 | [![coverage][codecov-image]][codecov-url]
|
---|
| 5 | [![dependency status][5]][6]
|
---|
| 6 | [![dev dependency status][7]][8]
|
---|
| 7 | [![License][license-image]][license-url]
|
---|
| 8 | [![Downloads][downloads-image]][downloads-url]
|
---|
| 9 |
|
---|
| 10 | [![npm badge][11]][1]
|
---|
| 11 |
|
---|
| 12 | Is this an ES6 Symbol value?
|
---|
| 13 |
|
---|
| 14 | ## Example
|
---|
| 15 |
|
---|
| 16 | ```js
|
---|
| 17 | var isSymbol = require('is-symbol');
|
---|
| 18 | assert(!isSymbol(function () {}));
|
---|
| 19 | assert(!isSymbol(null));
|
---|
| 20 | assert(!isSymbol(function* () { yield 42; return Infinity; });
|
---|
| 21 |
|
---|
| 22 | assert(isSymbol(Symbol.iterator));
|
---|
| 23 | assert(isSymbol(Symbol('foo')));
|
---|
| 24 | assert(isSymbol(Symbol.for('foo')));
|
---|
| 25 | assert(isSymbol(Object(Symbol('foo'))));
|
---|
| 26 | ```
|
---|
| 27 |
|
---|
| 28 | ## Tests
|
---|
| 29 | Simply clone the repo, `npm install`, and run `npm test`
|
---|
| 30 |
|
---|
| 31 | [1]: https://npmjs.org/package/is-symbol
|
---|
| 32 | [2]: https://versionbadg.es/inspect-js/is-symbol.svg
|
---|
| 33 | [5]: https://david-dm.org/inspect-js/is-symbol.svg
|
---|
| 34 | [6]: https://david-dm.org/inspect-js/is-symbol
|
---|
| 35 | [7]: https://david-dm.org/inspect-js/is-symbol/dev-status.svg
|
---|
| 36 | [8]: https://david-dm.org/inspect-js/is-symbol#info=devDependencies
|
---|
| 37 | [11]: https://nodei.co/npm/is-symbol.png?downloads=true&stars=true
|
---|
| 38 | [license-image]: https://img.shields.io/npm/l/is-symbol.svg
|
---|
| 39 | [license-url]: LICENSE
|
---|
| 40 | [downloads-image]: https://img.shields.io/npm/dm/is-symbol.svg
|
---|
| 41 | [downloads-url]: https://npm-stat.com/charts.html?package=is-symbol
|
---|
| 42 | [codecov-image]: https://codecov.io/gh/inspect-js/is-symbol/branch/main/graphs/badge.svg
|
---|
| 43 | [codecov-url]: https://app.codecov.io/gh/inspect-js/is-symbol/
|
---|
| 44 | [actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-symbol
|
---|
| 45 | [actions-url]: https://github.com/inspect-js/is-symbol/actions
|
---|